Uploaded image for project: 'Hadoop Map/Reduce'
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1166

SerialUtils.cc: dynamic allocation of arrays based on runtime variable is not portable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None

    Description

      In SerialUtils.cc, the following code appears:

      int len;
      if (b < -120)

      { negative = true; len = -120 - b; }

      else

      { negative = false; len = -112 - b; }

      uint8_t barr[len];

      as far as I'm aware, this is not legal in ANSI C and will be rejected by ANSI compliant compilers. Instead, this should be malloc()'d based upon the size of len and free()'d later.

      Attachments

        1. MAPREREDUCE-1166.patch
          0.5 kB
          Allen Wittenauer

        Activity

          People

            aw Allen Wittenauer
            aw Allen Wittenauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: