aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-05-26 00:55:20 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-05-28 06:50:41 +0700
commite4799f56030a1dc73c9ebf0092084dfaa332398d (patch)
treeb50b94893f74ca989a26e4a242050e996bceb960 /src/gsm
parent719408745786159cb0471477e015e155c14935b6 (diff)
gsm48_decode_bcd_number2(): return -EINVAL if LV has too big length
Diffstat (limited to 'src/gsm')
-rw-r--r--src/gsm/gsm48_ie.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gsm/gsm48_ie.c b/src/gsm/gsm48_ie.c
index 311836d3..688698db 100644
--- a/src/gsm/gsm48_ie.c
+++ b/src/gsm/gsm48_ie.c
@@ -70,7 +70,7 @@ int gsm48_decode_bcd_number(char *output, int output_len,
*
* Errors checked:
* - no or too little input data (-EIO),
- * - IE length exceeds input data size (-EIO),
+ * - IE length exceeds input data size (-EINVAL),
* - no or too little output buffer size (-ENOSPC),
* - decoded number exceeds size of the output buffer (-ENOSPC).
*
@@ -90,7 +90,7 @@ int gsm48_decode_bcd_number2(char *output, size_t output_len,
in_len = bcd_lv[0];
/* len + 1: the BCD length plus the length byte itself must fit in the input buffer. */
if (input_len < in_len + 1)
- return -EIO;
+ return -EINVAL;
for (i = 1 + h_len; i <= in_len; i++) {
/* lower nibble */