summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-05 07:45:08 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-07-05 07:45:08 +0200
commitb0b8a34dd54933567dbf270147ea0989901f42f8 (patch)
treeae56c4a1cf664ab02c039eb2b7fd031a2e800c07
parent9feef48eaf2ae79f724cedb137866d0f3f9741bf (diff)
nat: Please coverity and initialize the saveptr to NULL
Coverity complains about the saveptr used in the strtok_r. This is not a bug because we pass a string as part of the first call to strtok_r but it is easier to just initialize it. Addresses: Coverity CID 1042323
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
index 32ae0681b..6ff4541a0 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
@@ -193,7 +193,7 @@ static int forward_to_bsc(struct ctrl_cmd *cmd)
struct bsc_connection *bsc;
struct bsc_cmd_list *pending;
unsigned int nr;
- char *nr_str, *tmp, *saveptr;
+ char *nr_str, *tmp, *saveptr = NULL;
/* Skip over the beginning (bsc.) */
tmp = strtok_r(cmd->variable, ".", &saveptr);