Details
Description
Same macros in axutil_unix.h have dangerous definitions:
- ';' at the end of a definition that is defined like a function
- multiple statement without enclosing block
Those mistakes can be dangerous when the macro is called in the "then" part of an "if" statement.
Examples:
#define AXIS2_CLOSE_SOCKET_ON_EXIT(sock) fcntl(sock,F_SETFD, FD_CLOEXEC);
#define AXIS2_UNZOPEN2(zipfilename,ffunc) unzOpen2(zipfilename,NULL); memset(&ffunc, 0, sizeof(ffunc));
The first error is fixed by removing the ';'. The second one by enclosing the definition in "do
{ ... }while (0)".