1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

librpc: cab: Integer wrap protection for ndr_count_cfdata().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Jeremy Allison 2016-11-30 09:19:43 -08:00
parent 737599268f
commit d2fe23ae0a

View File

@ -57,6 +57,10 @@ uint32_t ndr_count_cfdata(const struct cab_file *r)
uint32_t count = 0, i;
for (i = 0; i < r->cfheader.cFolders; i++) {
if (count + r->cffolders[i].cCFData < count) {
/* Integer wrap. */
return 0;
}
count += r->cffolders[i].cCFData;
}