osmo-msc/openbsc/src/libmsc
Jacob Erlbeck 7ffa7b095f nitb: Fix IMSI/IMEI buffer handling (Coverity)
Currently the handling of the buffers is not done consistently. Some
code assumes that the whole buffer may be used to store the string
while at other places, the last buffer byte is left untouched in the
assumption that it contains a terminating NUL-character. The latter
is the correct behaviour.

This commit changes to code to not touch the last byte in the buffers
and to rely on the last byte being NUL. So the maximum IMSI/IMEI
length is GSM_IMSI_LENGTH-1/GSM_IMEI_LENGTH-1.

For information: We assume that we allocate the structure with
talloc_zero. This means we have NULed the entire imsi array and then
only write sizeof - 1 characters to it. So the last byte remains NUL.

Fixes: Coverity CID 1206568, 1206567
Sponsored-by: On-Waves ehf
2015-04-10 08:47:00 +02:00
..
Makefile.am Initial support for export + curses-visualization of measurements 2015-01-01 13:03:03 +01:00
auth.c src: use namespace prefix osmo_* for misc utils 2011-05-07 12:58:59 +02:00
ctrl_commands.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
db.c nitb: Fix IMSI/IMEI buffer handling (Coverity) 2015-04-10 08:47:00 +02:00
gsm_04_08.c nitb: Allow the network to decide if a subscriber should be created 2015-01-27 10:44:17 +01:00
gsm_04_11.c convert away from deprecated gsm_7bit_{encode,decode}() functions 2015-01-01 12:41:39 +01:00
gsm_04_11_helper.c sms: Increment the RP Message Reference for each transaction 2014-02-20 11:35:56 +01:00
gsm_04_80.c ussd: Move to use gsm_7bit_encode_n_ussd for USSD encoding 2013-12-26 22:17:45 +01:00
gsm_subscriber.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
meas_feed.c write_queue: Check the result of osmo_wqueue_enqueue and free 2015-03-28 18:13:37 +01:00
meas_feed.h Initial support for export + curses-visualization of measurements 2015-01-01 13:03:03 +01:00
mncc.c mncc: Complete definitions for all speech traffic frames at MNCC interface 2014-03-20 22:36:16 +01:00
mncc_builtin.c mncc: Use helper function to check if an MNCC frame is data (speech/traffic) 2014-03-20 22:36:16 +01:00
mncc_sock.c mncc: Use helper function to check if an MNCC frame is data (speech/traffic) 2014-03-20 22:36:16 +01:00
osmo_msc.c sms/dtap: Add log messages to analyse SMS message loss 2014-01-31 11:17:44 +01:00
rrlp.c src: use namespace prefix osmo_signal* 2011-05-06 12:12:31 +02:00
silent_call.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
smpp_openbsc.c smpp: Fix potential crash in handling submitSM 2015-02-08 09:56:31 +01:00
smpp_smsc.c write_queue: Check the result of osmo_wqueue_enqueue and free 2015-03-28 18:13:37 +01:00
smpp_smsc.h smpp: Move the coding/mode detection into a utils file 2013-07-27 20:03:10 +02:00
smpp_utils.c smpp: Move the coding/mode detection into a utils file 2013-07-27 20:03:10 +02:00
smpp_vty.c vty: Use vty_install_default() instead of bsc_install_default() 2013-10-30 15:19:00 +01:00
sms_queue.c SMS: Attempting to send SMS is not a NOTICEable event 2015-01-05 14:05:32 +01:00
token_auth.c msc: Add and use gsm_subscriber_group 2014-12-05 14:59:02 +01:00
transaction.c msc: Add net parameter to trans_alloc 2014-12-09 08:59:29 +01:00
ussd.c ussd: Reject and release unhandled SS requests/interrogation 2013-12-28 17:52:23 +01:00
vty_interface_layer3.c nitb: Check source string length before calling strncpy (Coverity) 2015-04-07 20:13:53 +02:00