mirror of
https://github.com/isc-projects/bind9.git
synced 2026-03-03 05:50:39 -05:00
Merge branch '3176-issue-45110-by-clusterfuzz-external-bind9-dns_master_load_fuzzer-undefined-shift-in-soa_get-v9_18' into 'v9_18'
Use unsigned arithmetic when shifting by 24 See merge request isc-projects/bind9!5917
This commit is contained in:
commit
9668d72f3c
3 changed files with 7 additions and 4 deletions
|
|
@ -112,7 +112,8 @@ index_to_disk(dns_journal_t *);
|
|||
|
||||
static inline uint32_t
|
||||
decode_uint32(unsigned char *p) {
|
||||
return ((p[0] << 24) + (p[1] << 16) + (p[2] << 8) + (p[3] << 0));
|
||||
return (((uint32_t)p[0] << 24) + ((uint32_t)p[1] << 16) +
|
||||
((uint32_t)p[2] << 8) + ((uint32_t)p[3] << 0));
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
|
|
@ -8517,8 +8517,9 @@ rdataset_current(dns_rdataset_t *rdataset, dns_rdata_t *rdata) {
|
|||
#if DNS_RDATASET_FIXED
|
||||
if ((rdataset->attributes & DNS_RDATASETATTR_LOADORDER) != 0) {
|
||||
unsigned int offset;
|
||||
offset = (raw[0] << 24) + (raw[1] << 16) + (raw[2] << 8) +
|
||||
raw[3];
|
||||
offset = ((unsigned int)raw[0] << 24) +
|
||||
((unsigned int)raw[1] << 16) +
|
||||
((unsigned int)raw[2] << 8) + (unsigned int)raw[3];
|
||||
raw = rdataset->private3;
|
||||
raw += offset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@
|
|||
|
||||
static inline uint32_t
|
||||
decode_uint32(unsigned char *p) {
|
||||
return ((p[0] << 24) + (p[1] << 16) + (p[2] << 8) + (p[3] << 0));
|
||||
return (((uint32_t)p[0] << 24) + ((uint32_t)p[1] << 16) +
|
||||
((uint32_t)p[2] << 8) + ((uint32_t)p[3] << 0));
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
|
|||
Loading…
Reference in a new issue