summaryrefslogtreecommitdiffstats
path: root/userspace/arptables/arptables.c
diff options
context:
space:
mode:
authorJaromír Končický <jkoncick@redhat.com>2013-10-15 21:40:20 +0200
committerBart De Schuymer <bdschuym@pandora.be>2013-10-15 21:40:20 +0200
commit461c0674967504fafe7feb7631c51e7fceb67753 (patch)
treece71ac13ed2aab8e8fc42c3d6079b2d24a557007 /userspace/arptables/arptables.c
parent3730ceb7c0a81781679321bfbf9eaa39cfcfb04e (diff)
make static analysis tool happy (false positive)
Diffstat (limited to 'userspace/arptables/arptables.c')
-rw-r--r--userspace/arptables/arptables.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/userspace/arptables/arptables.c b/userspace/arptables/arptables.c
index 5535ab2..8ef445a 100644
--- a/userspace/arptables/arptables.c
+++ b/userspace/arptables/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);