From: Stéphane Graber Date: Wed, 26 Nov 2014 21:40:04 +0000 (-0500) Subject: Fix nbd partition id test X-Git-Tag: lxc-1.1.0.alpha3~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ee12772a39f8a731e5eef9035d286a6e516a47;p=thirdparty%2Flxc.git Fix nbd partition id test Reported-by: David Binderman Signed-off-by: Stéphane Graber --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index c95f3f06d..75e689681 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -3018,7 +3018,7 @@ static int nbd_get_partition(const char *src) if (!p) return 0; p++; - if (*p < '1' && *p > '9') + if (*p < '1' || *p > '9') return 0; return *p - '0'; }