Wrong pointer read.

master
Philippe Pittoli 2022-02-04 02:43:49 +01:00
parent e6edfd0e43
commit 33f7c9ccfb
1 changed files with 4 additions and 2 deletions

View File

@ -478,9 +478,11 @@ struct ipc_error handle_new_message (struct ipc_event *event, struct ipc_ctx *ct
ipc_message_empty (m); ipc_message_empty (m);
free (m); free (m);
int fd = ctx->pollfd[index].fd;
#ifdef DEBUG #ifdef DEBUG
printf ("error when ipc_read: index %d fd %d error num %d, message: %s\n" printf ("error when ipc_read: index %d fd %d error num %d, message: %s\n"
, index, ctx->pollfd[index].fd , index, fd
, ret.error_code , ret.error_code
, ret.error_message); , ret.error_message);
#endif #endif
@ -489,7 +491,7 @@ struct ipc_error handle_new_message (struct ipc_event *event, struct ipc_ctx *ct
TEST_IPC_P (ipc_close (ctx, index), "cannot close a connection in handle_message"); TEST_IPC_P (ipc_close (ctx, index), "cannot close a connection in handle_message");
TEST_IPC_P (ipc_del (ctx, index), "cannot delete a connection in handle_message"); TEST_IPC_P (ipc_del (ctx, index), "cannot delete a connection in handle_message");
IPC_EVENT_SET (event, IPC_EVENT_TYPE_ERROR, index, ctx->pollfd[index].fd, NULL); IPC_EVENT_SET (event, IPC_EVENT_TYPE_ERROR, index, fd, NULL);
return rvalue; return rvalue;
} }