Changeset 997 for rpm/vendor/current/lib/header.c
- Timestamp:
- Feb 15, 2017, 11:57:06 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rpm/vendor/current/lib/header.c
r592 r997 195 195 entryInfo pe = (entryInfo) pev; 196 196 entryInfo info = iv; 197 int i; 197 int i, tsize; 198 int32_t end = 0; 198 199 199 200 for (i = 0; i < il; i++) { … … 205 206 info->count = ntohl(pe[i].count); 206 207 208 /* Previous data must not overlap */ 209 if (end > info->offset) 210 return i; 211 207 212 if (hdrchkType(info->type)) 208 213 return i; 209 214 if (hdrchkAlign(info->type, info->offset)) 210 215 return i; 211 if (hdrchkRange(dl, info->offset)) 216 217 /* For string types we can only check the array size is sane */ 218 tsize = typeSizes[info->type]; 219 if (tsize < 1) 220 tsize = 1; 221 222 /* Verify the data actually fits */ 223 end = info->offset + (info->count * tsize); 224 if (hdrchkRange(dl, end)) 212 225 return i; 213 if (hdrchkData(info->count)) 214 return i; 215 216 } 226 } 227 217 228 return -1; 218 229 }
Note:
See TracChangeset
for help on using the changeset viewer.