]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
fix undefined-shift in put_res_rec fuzz error: ../../source3/libsmb/nmblib.c:451...
authoreaglegai <eaglegai@163.com>
Thu, 28 Oct 2021 13:51:13 +0000 (21:51 +0800)
committerJeremy Allison <jra@samba.org>
Fri, 29 Oct 2021 20:29:26 +0000 (20:29 +0000)
Author:    eaglegai <eaglegai@163.com>

Signed-off-by: eaglegai <eaglegai@163.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Oct 29 20:29:26 UTC 2021 on sn-devel-184

source3/libsmb/nmblib.c

index ff009092bbf75ce6667367298c5ec78857b54cb0..607470f7e4eef6ad88cb312debe831ec9c07ec29 100644 (file)
@@ -449,7 +449,7 @@ static int put_res_rec(char *buf, size_t buflen, int offset,struct res_rec *recs
                if (buf) {
                        RSSVAL(buf,offset,recs[i].rr_type);
                        RSSVAL(buf,offset+2,recs[i].rr_class);
-                       RSIVAL(buf,offset+4,recs[i].ttl);
+                       RSIVAL(buf,offset+4,(unsigned int)recs[i].ttl);
                        RSSVAL(buf,offset+8,recs[i].rdlength);
                        memcpy(buf+offset+10,recs[i].rdata,recs[i].rdlength);
                }