summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorNickolai Zeldovich <nickolai@csail.mit.edu>2013-01-17 13:58:28 -0500
committerSteffen Klassert <steffen.klassert@secunet.com>2013-01-18 06:19:49 +0100
commite2f6725917ed525f4111c33c31ab53397b70f9d2 (patch)
tree973e37521d6c65eaba2313950ca22b7ca8bee0c4 /usr
parenta9403f8aeb3e7dba6988d6cbe436e6521894e427 (diff)
downloadop-kernel-dev-e2f6725917ed525f4111c33c31ab53397b70f9d2.zip
op-kernel-dev-e2f6725917ed525f4111c33c31ab53397b70f9d2.tar.gz
net/xfrm/xfrm_replay: avoid division by zero
All of the xfrm_replay->advance functions in xfrm_replay.c check if x->replay_esn->replay_window is zero (and return if so). However, one of them, xfrm_replay_advance_bmp(), divides by that value (in the '%' operator) before doing the check, which can potentially trigger a divide-by-zero exception. Some compilers will also assume that the earlier division means the value cannot be zero later, and thus will eliminate the subsequent zero check as dead code. This patch moves the division to after the check. Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud