From b0b8a34dd54933567dbf270147ea0989901f42f8 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 5 Jul 2013 07:45:08 +0200 Subject: 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 --- openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c') 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); -- cgit v1.2.3