[PATCH 4/4] nitb: Fix IMSI/IMEI buffer handling (Coverity)

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Tue Apr 7 18:13:05 UTC 2015


On Tue, Apr 07, 2015 at 05:49:50PM +0200, Jacob Erlbeck wrote:

> 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: "rely" here means.. 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




More information about the OpenBSC mailing list