afs: Fix bounds check in PNewCell 82/12782/2
authorBenjamin Kaduk <kaduk@mit.edu>
Tue, 28 Nov 2017 04:17:28 +0000 (22:17 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Tue, 28 Nov 2017 15:15:37 +0000 (10:15 -0500)
commit4fa0ee620cfb9991ca9748b5ee116cc8e1e6c505
tree5cecd47782be273f9d29dcb4c44b9d1cf34e2a07
parent66b74e78ba5fea6a8236dcd3b8b46e1dfa6a0ac7
afs: Fix bounds check in PNewCell

Reported by the opensuse buildbot:

CC [M] /home/buildbot/opensuse-tumbleweed-i386-builder/build/src/libafs/MODLOAD-4.13.12-1-default-MP/rx_packet.o
/home/buildbot/opensuse-tumbleweed-i386-builder/build/src/afs/afs_pioctl.c: In function ‘PNewCell’:
/home/buildbot/opensuse-tumbleweed-i386-builder/build/src/afs/afs_pioctl.c:3075:55: error: ‘*’ in boolean context, suggest ‘&&’ instead [-Werror=int-in-bool-context]
     if ((afs_pd_remaining(ain) < AFS_MAXCELLHOSTS +3) * sizeof(afs_int32))
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~

The bug was introduced in commit 718f85a8b6.

Change-Id: Iae55a99e35266aa763fb431f2acc4eba09fa5357
Reviewed-on: https://gerrit.openafs.org/12782
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_pioctl.c