summaryrefslogtreecommitdiffstats
path: root/axconfig.c
diff options
context:
space:
mode:
authorThomas Osterried <thomas@osterried.de>2009-04-09 13:25:14 +0000
committerThomas Osterried <thomas@osterried.de>2009-04-09 13:25:14 +0000
commit49741bec9c1a5725f175a1a0f4b4e4c0eb6834a9 (patch)
tree473a475135f5bd7ec117ab771afa8f81fbcf0f72 /axconfig.c
parentab92cf5d7b324c53c7a7c2ffbbb8d9b2ec18e722 (diff)
nrconfig.c: call comparison fix.
axconfig.c, nrconfig.c and rsconfig.c: assurances against null pointer deferences.
Diffstat (limited to 'axconfig.c')
-rw-r--r--axconfig.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/axconfig.c b/axconfig.c
index fd48067..572df99 100644
--- a/axconfig.c
+++ b/axconfig.c
@@ -219,11 +219,11 @@ static int ax25_config_init_port(int fd, int lineno, char *line, const char **if
}
for (p = ax25_ports; p != NULL; p = p->Next) {
- if (strcasecmp(name, p->Name) == 0) {
+ if (p->Name != NULL && strcasecmp(name, p->Name) == 0) {
fprintf(stderr, "axconfig: duplicate port name %s in line %d of axports file\n", name, lineno);
return FALSE;
}
- if (is_same_call(call, p->Call)) {
+ if (p->Call != NULL && is_same_call(call, p->Call)) {
fprintf(stderr, "axconfig: duplicate callsign %s in line %d of axports file\n", call, lineno);
return FALSE;
}
@@ -361,15 +361,13 @@ int ax25_config_load_ports(void)
break;
devlist = pp;
if ((calllist[callcount] = strdup(s)) != NULL) {
- if (calllist[callcount]) {
- if ((devlist[callcount] = strdup(ifr.ifr_name)) != NULL) {
- ++callcount;
- calllist[callcount] = NULL;
- devlist [callcount] = NULL;
- } else {
- free((void*)calllist[callcount]);
- calllist[callcount] = NULL;
- }
+ if ((devlist[callcount] = strdup(ifr.ifr_name)) != NULL) {
+ ++callcount;
+ calllist[callcount] = NULL;
+ devlist [callcount] = NULL;
+ } else {
+ free((void*)calllist[callcount]);
+ calllist[callcount] = NULL;
}
}
}