Commit e0ff84f6 authored by mir's avatar mir

Scan build: Argument with 'nonnull' attribute passed null

parent 82597e7e
......@@ -79,6 +79,7 @@ int processoption(paramdef_t *cfgoptions, char *value) {
if ( value == NULL) {
if( (cfgoptions->paramflags &PARAMFLAG_BOOL) == 0 ) { /* not a boolean, argument required */
CONFIG_PRINTF_ERROR("[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname);
AssertFatal(false, "[CONFIG] command line, requires an argument\n");
} else { /* boolean value option without argument, set value to true*/
tmpval = defbool;
}
......
......@@ -214,7 +214,7 @@ int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *
int j = 0;
for (; j < shlib->numfunc; ++j) {
if (shlib->funcarray[j].fptr == farray[i].fptr) {
int rc = strcmp(shlib->funcarray[i].fname, farray[i].fname);
int rc = strcmp(shlib->funcarray[j].fname, farray[i].fname);
AssertFatal(rc == 0,
"reloading the same fptr with different fnames (%s, %s)\n",
shlib->funcarray[i].fname, farray[i].fname);
......
......@@ -55,8 +55,9 @@ void randominit(unsigned long seed_init)
unsigned long seed = seed_init;
if (seed_init == 0)
fill_random(&seed, sizeof(seed));
if (getenv("OAI_RNGSEED"))
seed = atoi(getenv("OAI_RNGSEED"));
const char* str_oai_rngseed = getenv("OAI_RNGSEED");
if (str_oai_rngseed != NULL)
seed = atoi(str_oai_rngseed);
printf("Initializing random number generator, seed %lu\n", seed);
// initialize uniformrandom RNG
......
......@@ -53,10 +53,12 @@ static void get_NGU_S1U_addr(char **addr, uint16_t *port)
char *address;
if (NETParams[1].strptr != NULL) {
LOG_I(GTPU, "SA mode \n");
AssertFatal(gnb_ipv4_address_for_NGU != NULL, "Undefined Behaviour");
address = strdup(gnb_ipv4_address_for_NGU);
*port = gnb_port_for_NGU;
} else {
LOG_I(GTPU, "NSA mode \n");
AssertFatal(gnb_ipv4_address_for_S1U != NULL, "Undefined Behaviour");
address = strdup(gnb_ipv4_address_for_S1U);
*port = gnb_port_for_S1U;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment