Fix illegal memory access errors triggered by running srconv on fuzzed binaries.
[deliverable/binutils-gdb.git] / binutils / coffgrok.c
index 2bbfdc45b42bc4af07ccdc87a24eb6a6a21b952a..0b953e8d6bd8ce02e38738f88aad6557af2f4e44 100644 (file)
@@ -668,12 +668,10 @@ do_define (unsigned int i, struct coff_scope *b)
 
          if (!is->init)
            {
-             long high = s->where->offset + s->type->size; 
-
              is->low = s->where->offset;
-             is->high = high;
+             is->high = s->where->offset + s->type->size; 
              /* PR 17512: file: 37e7a80d.  */
-             if (is->high != high)
+             if (is->high < s->where->offset)
                fatal (_("Out of range type size: %u"), s->type->size);
              is->init = 1;
              is->parent = s->where->section;
This page took 0.02448 seconds and 4 git commands to generate.