[llvm] r241831 - [llvm-readobj] Re-add sanity checking which was accidentally removed in r241764

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri Jul 10 11:11:51 PDT 2015


Can it be tested?

On 9 July 2015 at 14:14, David Majnemer <david.majnemer at gmail.com> wrote:
> Author: majnemer
> Date: Thu Jul  9 13:14:31 2015
> New Revision: 241831
>
> URL: http://llvm.org/viewvc/llvm-project?rev=241831&view=rev
> Log:
> [llvm-readobj] Re-add sanity checking which was accidentally removed in r241764
>
> Modified:
>     llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
>
> Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=241831&r1=241830&r2=241831&view=diff
> ==============================================================================
> --- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)
> +++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Thu Jul  9 13:14:31 2015
> @@ -597,8 +597,15 @@ void COFFDumper::printCodeViewDebugInfo(
>        // in the line table.  The filename string is accessed using double
>        // indirection to the string table subsection using the index subsection.
>        uint32_t OffsetInIndex = DE.getU32(&Offset),
> -               SegmentLength = DE.getU32(&Offset);
> -      Offset += sizeof(uint32_t); // Skip FullSegmentSize
> +               SegmentLength = DE.getU32(&Offset),
> +               FullSegmentSize = DE.getU32(&Offset);
> +
> +      if (FullSegmentSize !=
> +          12 + 8 * SegmentLength +
> +              (HasColumnInformation ? 4 * SegmentLength : 0)) {
> +        error(object_error::parse_failed);
> +        return;
> +      }
>
>        uint32_t FilenameOffset;
>        {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list