Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1467

Dangerous macros defs in axutil_unix.h and axutil_windows.h

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • None

    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)".

      Attachments

        1. AXIS2C-1467_macros.patch
          2 kB
          Olivier Mengué

        Activity

          People

            Unassigned Unassigned
            dolmen-oxymel Olivier Mengué
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: