]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc ndr: Change loop index to size_t
authorGary Lockyer <gary@catalyst.net.nz>
Wed, 22 Jan 2020 01:18:00 +0000 (14:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 7 Feb 2020 08:53:40 +0000 (08:53 +0000)
Change the loop index in ndr_check_padding to size_t.

Credit to OSS-Fuzz

REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
librpc/ndr/ndr_basic.c

index 0811a5909719dbf7ecbfa3baa4ebf98d089f555e..693d9c86e3ab419d608635da936241efdb0af817 100644 (file)
@@ -44,7 +44,7 @@ static void ndr_dump_data(struct ndr_print *ndr, const uint8_t *buf, int len);
 _PUBLIC_ void ndr_check_padding(struct ndr_pull *ndr, size_t n)
 {
        size_t ofs2 = (ndr->offset + (n-1)) & ~(n-1);
-       int i;
+       size_t i;
        for (i=ndr->offset;i<ofs2;i++) {
                if (ndr->data[i] != 0) {
                        break;