From ea2a0ab041524bb651d488ea1eddda0cc3d9e895 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 5 Dec 2018 23:30:08 +0100 Subject: gsm48_mi_to_string(): guard against zero length output buffer All successful cases already return from the switch(), so simply handle all errors below it by returning an empty string (if there is enough string buffer). Change-Id: I709ac3b9efb7b4258d8660715b10312e11b9b571 --- tests/gsm0408/gsm0408_test.ok | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/gsm0408') diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index 6e99f5b3..d6579e50 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -72,8 +72,8 @@ Decoding zero length Mobile Identities returned empty string - MI type: TMSI - writing to zero-length string: - rc=1 - ERROR: Wrote to invalid memory! + rc=0 + nothing written - writing to 1-byte-length string: rc=1 returned empty string @@ -82,8 +82,8 @@ Decoding zero length Mobile Identities returned empty string - MI type: NONE - writing to zero-length string: - rc=1 - ERROR: Wrote to invalid memory! + rc=0 + nothing written - writing to 1-byte-length string: rc=1 returned empty string @@ -102,8 +102,8 @@ Decoding zero length Mobile Identities returned empty string - MI type: TMSI | GSM_MI_ODD - writing to zero-length string: - rc=1 - ERROR: Wrote to invalid memory! + rc=0 + nothing written - writing to 1-byte-length string: rc=1 returned empty string @@ -112,8 +112,8 @@ Decoding zero length Mobile Identities returned empty string - MI type: NONE | GSM_MI_ODD - writing to zero-length string: - rc=1 - ERROR: Wrote to invalid memory! + rc=0 + nothing written - writing to 1-byte-length string: rc=1 returned empty string -- cgit v1.2.3