summaryrefslogtreecommitdiff
path: root/print-vsock.c
diff options
context:
space:
mode:
authorBill Fenner <fenner@gmail.com>2022-10-11 13:13:58 -0700
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2023-04-19 19:29:26 +0200
commitdf5cba8d99ed9b99ecf1da9e4e0a115509209a91 (patch)
treeb5d226c17c121361bd5b97c823494670637a3f01 /print-vsock.c
parent541c1ab5e795684abb3e3b372a68055404190a1a (diff)
downloadtcpdump-df5cba8d99ed9b99ecf1da9e4e0a115509209a91.tar.gz
SNMP: Fix two undefined behaviors
When converting an integer from ASN.1, use an unsigned value for the partial result and assign it to the integer part of the union at the end, to avoid shifting a negative number left. print-snmp.c:545:19: runtime error: left shift of negative value -1 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-snmp.c:545:19 OID elements are unsigned; a large-enough oid value could result in the undefined behavior of shifting a signed integer left through the sign bit, so simply store them as unsigned. print-snmp.c:751:11: runtime error: left shift of 268435455 by 7 places cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior print-snmp.c:751:11 [Part of the PR #1012]
Diffstat (limited to 'print-vsock.c')
0 files changed, 0 insertions, 0 deletions