]> git.ozlabs.org Git - ppp.git/commit
plugins/pppoatm: Restructure code to avoid possibility of integer overflow
authorPaul Mackerras <paulus@ozlabs.org>
Tue, 20 Aug 2024 10:27:31 +0000 (20:27 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 20 Aug 2024 10:27:31 +0000 (20:27 +1000)
commit17f324057084e73d1b21b58906dc3e42b958054f
treed9c3dfd4bf7149f9f6ce71c819a103627d62ac5a
parent7eb932ba780c8773ddb1fb20495d5b5e748837ff
plugins/pppoatm: Restructure code to avoid possibility of integer overflow

This avoids the theoretical possibility of integer overflow in
adding a constant before dividing in order to get the effect of
rounding up.  Instead we divide and add 1 if the original value modulo
the divisor is non-zero.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
pppd/plugins/pppoatm/text2qos.c