diff options
author | Jaromír Končický <jkoncick@redhat.com> | 2013-10-15 21:40:20 +0200 |
---|---|---|
committer | Bart De Schuymer <bdschuym@pandora.be> | 2013-10-15 21:40:20 +0200 |
commit | ee4ec133bc5616f3d2b9efd468dfc1d42ca1c17d (patch) | |
tree | 34c6456b483963a5674e6ed5c6b9b4a76536a7e0 | |
parent | b064d44bd2581444108b1bdf8de1b8752246321f (diff) |
make static analysis tool happy (false positive)
-rw-r--r-- | arptables.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arptables.c b/arptables.c index 5535ab2..8ef445a 100644 --- a/arptables.c +++ b/arptables.c @@ -1668,10 +1668,12 @@ static char *get_modprobe(void) ret = malloc(1024); if (ret) { - switch (read(procfile, ret, 1024)) { + int read_bytes = read(procfile, ret, 1024); + switch (read_bytes) { case -1: goto fail; case 1024: goto fail; /* Partial read. Wierd */ } + ret[read_bytes] = '\0'; if (ret[strlen(ret)-1]=='\n') ret[strlen(ret)-1]=0; close(procfile); |