summaryrefslogtreecommitdiffstats
path: root/include/osmocom/gsm
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2019-04-01 14:34:37 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2019-05-03 16:15:24 +0200
commit8212fc6a7d9cfd6c5e71f522863c3e3420262360 (patch)
tree835e2f767fcfb939626f7951a599e7d9ac2427ec /include/osmocom/gsm
parentf7e9c51bdc61713c39a26f28a469173f225f4711 (diff)
add gsm48_decode_bcd_number2() from osmo-msc
gsm48_decode_bcd_number() is unable to provide proper bounds validation of input and output data, hence osmo-msc's vlr.c introduced a static decode_bcd_number_safe() a long time ago. Move to libosmocore. I need to use the same function to decode an MSISDN during inter-MSC Handover, instead of making it public in osmo-msc, rather deprecate the unsafe function and provide a safer version for all callers. Mark the old one deprecated. Change-Id: Idb6ae6e2f3bea11ad420dae14d021ac36d99e921
Diffstat (limited to 'include/osmocom/gsm')
-rw-r--r--include/osmocom/gsm/gsm48_ie.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/osmocom/gsm/gsm48_ie.h b/include/osmocom/gsm/gsm48_ie.h
index f7cc24ea..71050df5 100644
--- a/include/osmocom/gsm/gsm48_ie.h
+++ b/include/osmocom/gsm/gsm48_ie.h
@@ -13,7 +13,11 @@
/* decode a 'called/calling/connect party BCD number' as in 10.5.4.7 */
int gsm48_decode_bcd_number(char *output, int output_len,
- const uint8_t *bcd_lv, int h_len);
+ const uint8_t *bcd_lv, int h_len)
+ OSMO_DEPRECATED("Use gsm48_decode_bcd_number2() for improved bounds checking");
+int gsm48_decode_bcd_number2(char *output, size_t output_len,
+ const uint8_t *bcd_lv, size_t input_len,
+ size_t h_len);
/* convert a ASCII phone number to 'called/calling/connect party BCD number' */
int gsm48_encode_bcd_number(uint8_t *bcd_lv, uint8_t max_len,