From: Christian Brauner Date: Tue, 1 May 2018 15:17:03 +0000 (+0200) Subject: coverity: #1248104 X-Git-Tag: lxc-3.1.0~313^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0382c0da7b78acc007a1716e6471cc8f1b9ad804;p=thirdparty%2Flxc.git coverity: #1248104 Argument cannot be negative Signed-off-by: Christian Brauner --- diff --git a/src/lxc/network.c b/src/lxc/network.c index e31066cb9..cbffe8ef6 100644 --- a/src/lxc/network.c +++ b/src/lxc/network.c @@ -592,6 +592,8 @@ static char *is_wlan(const char *ifname) fseek(f, 0, SEEK_END); physlen = ftell(f); fseek(f, 0, SEEK_SET); + if (physlen < 0) + goto bad; physname = malloc(physlen + 1); if (!physname) {