Changeset 838


Ignore:
Timestamp:
2012-03-25T04:24:14+02:00 (2 years ago)
Author:
moo
Message:

avoid overflow in memsetptr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r836 r838  
    107107    void **p = (void **) mem; 
    108108    void **end = (char *) mem + n; 
    109     while (p < end) { 
     109    while (p < end - sizeof(content)) { 
    110110        *p = content; 
    111111        p += sizeof(content); 
     112    } 
     113    if (p < end) { 
     114        memset(p, -1, end - p); 
    112115    } 
    113116    return mem; 
Note: See TracChangeset for help on using the changeset viewer.