From 14f56750fcf51a1d6daa14da08b34eb789241a23 Mon Sep 17 00:00:00 2001 From: eaglegai Date: Thu, 28 Oct 2021 21:51:13 +0800 Subject: [PATCH] fix undefined-shift in put_res_rec fuzz error: ../../source3/libsmb/nmblib.c:451:4: runtime error: left shift of 65312 by 16 places cannot be represented in type 'int' Author: eaglegai Signed-off-by: eaglegai Reviewed-by: Jeremy Allison Reviewed-by: Douglas Bagnall Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Oct 29 20:29:26 UTC 2021 on sn-devel-184 --- source3/libsmb/nmblib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c index ff009092bbf..607470f7e4e 100644 --- a/source3/libsmb/nmblib.c +++ b/source3/libsmb/nmblib.c @@ -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); } -- GitLab