Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1166

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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.

      1. MAPREREDUCE-1166.patch
        0.5 kB
        Allen Wittenauer

        Activity

        Allen Wittenauer created issue -
        Allen Wittenauer made changes -
        Field Original Value New Value
        Project Hadoop Common [ 12310240 ] Hadoop Map/Reduce [ 12310941 ]
        Key HADOOP-6263 MAPREDUCE-1166
        Allen Wittenauer made changes -
        Attachment MAPREREDUCE-1166.patch [ 12423600 ]
        Allen Wittenauer made changes -
        Attachment MAPREREDUCE-1166.patch [ 12423600 ]
        Allen Wittenauer made changes -
        Attachment MAPREREDUCE-1166.patch [ 12423604 ]
        Allen Wittenauer made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Chris Douglas made changes -
        Assignee Allen Wittenauer [ aw ]
        Allen Wittenauer made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Allen Wittenauer made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]

          People

          • Assignee:
            Allen Wittenauer
            Reporter:
            Allen Wittenauer
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development