-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49559/
-----------------------------------------------------------

(Updated July 2, 2016, 8:08 p.m.)


Review request for mesos and Benjamin Mahler.


Changes
-------

Uploaded binary diff for `elfio-3.1.tar.gz`


Bugs: MESOS-5767
    https://issues.apache.org/jira/browse/MESOS-5767


Repository: mesos


Description
-------

This includes a patch file to ELFIO to fix 2 off-by-one errors in the
parsing of NOTE sections. Patches for these bugs have been submitted
upstream. Details of the patches are below:

1) Fixed off-by-one error in 'name' of add_note() function.

Previously, when assigning 'name' as a string, it's length was
specified using the full length of 'namesz'. However, this length
includes the trailing '\0' of the underlying char[]. This ultimately
causes the C++ string that is created to (incorrectly) contain the
'\0' character as well. This leads to problems where e.g. the
following will return false, even when 'name' itself contains the
string "GNU\0":

  if (name == "GNU") {
    return true;
  }
  return false;

To fix this, we should only include the length of the string minus the
trailing '\0'.

2) Fixed alignment of 'desc' in add_note() function.

The ELF spec specifically lists the alignment of the namez char[] to
be 4 bytes. To quote it:

"Padding is present, if necessary, to ensure 4-byte alignment for the
descriptor. Such padding is not included in namesz."

However, the current implementation sets the alignment to either 4 or
8 bytes depending on the class of the ELF file (CLASS32 or CLASS64).
This commit fixes the alignment to only 4 bytes in all cases.


Diffs (updated)
-----

  3rdparty/CMakeLists.txt 15f3171 
  3rdparty/Makefile.am bd990cc 
  3rdparty/cmake/Versions.cmake 7b73f8f 
  3rdparty/elfio-3.1.patch PRE-CREATION 
  3rdparty/elfio-3.1.tar.gz PRE-CREATION 
  3rdparty/versions.am 203656c 
  LICENSE eb39f6d 
  configure.ac 321436b 
  src/Makefile.am 52d63f2 
  support/coverage.sh ab9564b 

Diff: https://reviews.apache.org/r/49559/diff/


Testing
-------

Made sure `elfio-3.1` appears in `/build` after running `../configure`, `make`.
Made sure `elfio` appears in `/include` of installation folder after `make 
install`.

This second one is necessary because `stout` relies on elfio in order to 
function (similar to how we've done with `picojson.h` in the past).


Thanks,

Kevin Klues

Reply via email to