]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
coverity: #1248104
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 1 May 2018 15:17:03 +0000 (17:17 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 10 May 2018 18:24:48 +0000 (20:24 +0200)
Argument cannot be negative

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/network.c

index e31066cb951d5224d43b88233e660afad8ff8a57..cbffe8ef6faa014451aaea12a5dc23cd1ef6c77c 100644 (file)
@@ -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) {