Module Name:    src
Committed By:   rillig
Date:           Thu Feb 22 18:26:16 UTC 2024

Modified Files:
        src/common/lib/libutil: snprintb.c
        src/lib/libutil: snprintb.3
        src/tests/lib/libutil: t_snprintb.c

Log Message:
snprintb: error out on out-of-bounds bit shifts

Previously, these invoked undefined behavior, now they lead to an early
return. An example of out-of-bounds bit number is in SCZ_PCICTRL_BITS.
Bit fields that extend beyond the msb are still allowed.

Allow 'f' and 'F' to have fields that are 64 bits wide. This only makes
sense when the field starts at bit 0.

Remove the unused 'val_len', it was only needed before snprintb.c 1.20.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/common/lib/libutil/snprintb.c
cvs rdiff -u -r1.33 -r1.34 src/lib/libutil/snprintb.3
cvs rdiff -u -r1.25 -r1.26 src/tests/lib/libutil/t_snprintb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to