ranap_parse_lai(): properly initialize out-arg, adjust test experr

The test stderr output changes merely because the source code line numbers
of the error logging changed.

Fixes: CID#93770
This commit is contained in:
Neels Hofmeyr 2016-04-25 13:12:58 +02:00
parent 3d12748f5b
commit f6e56058f4
2 changed files with 6 additions and 2 deletions

View File

@ -498,6 +498,10 @@ int ranap_parse_lai(struct gprs_ra_id *ra_id, const RANAP_LAI_t *lai)
{
uint8_t *ptr = lai->pLMNidentity.buf;
/* Avoid unitialized mem for parse failures, and set rac to zero (which
* isn't being parsed). */
*ra_id = (struct gprs_ra_id){ .lac = 0xfffe };
/* TS 25.413 9.2.3.55 */
if (lai->pLMNidentity.size != 3) {
LOGP(DRANAP, LOGL_ERROR, "Invalid PLMN Identity size:"

View File

@ -1,3 +1,3 @@
<0004> ranap_common.c:504 Invalid PLMN Identity size: should be 3, is 2
<0004> ranap_common.c:518 Invalid LAC size: should be 2, is 1
<0004> ranap_common.c:508 Invalid PLMN Identity size: should be 3, is 2
<0004> ranap_common.c:522 Invalid LAC size: should be 2, is 1