summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2017-01-04 12:05:49 +0100
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2017-01-04 12:05:49 +0100
commitaabdfa67919ccca9238463bc7785dce4c1a99894 (patch)
treee67cd74dd8d6054c8e471669e876db7bc3ec398f /src
parentf3fbf2c6093b293f995c4d784509577695e052b1 (diff)
downloadouroboros-aabdfa67919ccca9238463bc7785dce4c1a99894.tar.gz
ouroboros-aabdfa67919ccca9238463bc7785dce4c1a99894.zip
ipcpd: Fix uninitialized variables in ribmgr
Diffstat (limited to 'src')
-rw-r--r--src/ipcpd/normal/ribmgr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c
index ab492e7f..d0bd3ec7 100644
--- a/src/ipcpd/normal/ribmgr.c
+++ b/src/ipcpd/normal/ribmgr.c
@@ -312,13 +312,13 @@ static struct rnode * ribmgr_ro_create(const char * name,
{
char * str;
char * str1;
- char * saveptr;
- char * token;
+ char * saveptr = NULL;
+ char * token = NULL;
char * token2;
struct rnode * node;
struct rnode * new;
struct rnode * prev;
- bool sibling;
+ bool sibling = false;
int timeout;
str = strdup(name);
@@ -327,6 +327,8 @@ static struct rnode * ribmgr_ro_create(const char * name,
node = rib.root;
+ assert(node);
+
for (str1 = str; node != NULL; str1 = NULL) {
token = strtok_r(str1, PATH_DELIMITER, &saveptr);
if (token == NULL) {
@@ -351,6 +353,8 @@ static struct rnode * ribmgr_ro_create(const char * name,
}
}
+ assert(token);
+
token2 = strtok_r(NULL, PATH_DELIMITER, &saveptr);
if (token2 != NULL) {
LOG_ERR("Part of the pathname does not exist.");