From a6ee12772a39f8a731e5eef9035d286a6e516a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 26 Nov 2014 16:40:04 -0500 Subject: [PATCH] Fix nbd partition id test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported-by: David Binderman Signed-off-by: Stéphane Graber --- src/lxc/bdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'; }