X-Git-Url: http://git.samba.org/?a=blobdiff_plain;f=source3%2Fsmbd%2Fnttrans.c;h=bcba29a3e899c88bd0f301451ecbd9680e37fc9d;hb=c8d8bb257ac390c89c4238ed86dfef02750b6049;hp=800e2fd260be334479ca6c4d57d2df69eec2479c;hpb=6659f0164c6b8d7ad522bcd6c2c6748c3d9bca81;p=metze%2Fsamba%2Fwip.git diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 800e2fd260be..bcba29a3e899 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -990,7 +990,19 @@ struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t if (next_offset == 0) { break; } + + /* Integer wrap protection for the increment. */ + if (offset + next_offset < offset) { + break; + } + offset += next_offset; + + /* Integer wrap protection for while loop. */ + if (offset + 4 < offset) { + break; + } + } return ea_list_head;