]> git.decadent.org.uk Git - nfs-utils.git/commit
mount.nfs: Do not segfault because of kernel version
authorLuk Claes <luk@debian.org>
Tue, 12 Jul 2011 14:38:03 +0000 (10:38 -0400)
committerLuk Claes <luk@debian.org>
Sun, 2 Oct 2011 14:16:45 +0000 (16:16 +0200)
commit8e0c977a6bf69616820403a970046be30b4208bf
tree5813ae2e5dfb40a5a98c6350bd9019e539938566
parent4cbf492fba6656c245c537e50379f80f4e66d0e7
mount.nfs: Do not segfault because of kernel version

mount.nfs segfaults if kernel version number does not contain
at least 3 components delimited with a dot.

Avoid this by matching up to three unsigned integers inialised
to zero, separated by dots.

A version that does not start with an integer is probably a future
version where the versioning evolved to another scheme.
Return UINT_MAX which is guaranteed to be higher than existing
versions. This would also make it possible to easily identify
versions that do not start with an integer.

Signed-off-by: Luk Claes <luk@debian.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mount/version.h