> Begin forwarded message:
>
> From: scan-admin(a)coverity.com
> Subject: New Defects reported by Coverity Scan for Osmocom
> Date: 18 March 2016 at 18:01:06 GMT+1
> To: holger(a)freyther.de
>
>
> Hi,
>
> Please find the latest report on new defect(s) introduced to Osmocom found with Coverity Scan.
>
> 2 new defect(s) introduced to Osmocom found with Coverity Scan.
>
>
> New defect(s) Reported-by: Coverity Scan
> Showing 2 of 2 defect(s)
>
> ________________________________________________________________________________________________________
> *** CID 76332: API usage errors (PW.TOO_MANY_PRINTF_ARGS)
> /source-iuh/openbsc/openbsc/src/gprs/gprs_gmm.c: 120 in ()
> 114 case IU_EVENT_RAB_ASSIGN:
> 115 rc = sgsn_ranap_rab_ass_resp(mm, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
> 116 break;
> 117 case IU_EVENT_IU_RELEASE:
> 118 mm->iu.integrity_active = 0;
> 119 /* Clean up ue_conn_ctx here */
>>>> CID 76332: API usage errors (PW.TOO_MANY_PRINTF_ARGS)
>>>> the format string ends before this argument
> 120 LOGMMCTXP(LOGL_INFO, mm, "IU release\n", type);
harmless, but easy to fix and the compiler already warns
>
> 46 llist_for_each_entry(conn, &network->subscr_conns, entry) {
>>>> CID 76331: API usage errors (PW.PRINTF_ARG_MISMATCH)
>>>> argument is incompatible with corresponding format string conversion
> 47 DEBUGP(DIUCS, "%3d: %s", i++, subscr_name(conn->subscr));
please avoid side-effects like this in DEBUGP. It might be completely off but with recent changes it might or might not be evaluated depending on your logging settings.
holger
Hello all!
I just quickly looked at the gsm48_mi_to_string() method in gsm48.c.
I found that it is used in several projects like OsmocomBB and OpenBSC,
but it seems a bit strange to me that the TMSI represented in decimal...
> ...
> uint32_t tmsi;
> ...
> return snprintf(string, str_len, "%u", tmsi);
> ...
Can we move to use a hex representation instead of decimal? And why if not?
> ...
> uint32_t tmsi;
> ...
> return snprintf(string, str_len, "%x", tmsi);
> ...
С наилучшими пожеланиями,
Яницкий Вадим.