summaryrefslogtreecommitdiffstats
path: root/axconfig.c
diff options
context:
space:
mode:
authorThomas Osterried <ax25@x-berg.in-berlin.de>2022-05-02 02:21:01 +0200
committerThomas Osterried <ax25@x-berg.in-berlin.de>2022-05-02 02:21:01 +0200
commita37aceea9ffbcbdc25819443905369a6f8cd395e (patch)
treebc5b295f400adedefcba11e342cd3d6b359fb1b8 /axconfig.c
parent25619cc79e58a68bf88381a75ecdf93a9b8f9c90 (diff)
parent415b2d46a39302b21b51758e83f81e5439ab487c (diff)
Merge branch 'master' of ssh://git.linux-ax25.org/pub/scm/libax25
Diffstat (limited to 'axconfig.c')
-rw-r--r--axconfig.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/axconfig.c b/axconfig.c
index 84199c1..c6a2cb0 100644
--- a/axconfig.c
+++ b/axconfig.c
@@ -15,7 +15,9 @@
#include <netax25/axconfig.h>
#include <netax25/axlib.h>
#include <netrose/rose.h>
+
#include "pathnames.h"
+#include "util.h"
typedef struct _axport
{
@@ -308,10 +310,12 @@ int ax25_config_load_ports(void)
break;
s = strchr(buffer, ':');
if (s) *s = 0;
- s = buffer;
+ s = buffer;
while (isspace(*s & 0xff)) ++s;
memset(&ifr, 0, sizeof(ifr));
+ if (strlen(s) >= IFNAMSIZ)
+ unreachable();
strncpy(ifr.ifr_name, s, IFNAMSIZ-1);
ifr.ifr_name[IFNAMSIZ-1] = 0;