Potential bug / problematic code in gsm411_rx_rl_data()

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/baseband-devel@lists.osmocom.org/.

Sylvain Munaut 246tnt at gmail.com
Wed Jan 2 09:35:35 UTC 2013


> In gsm411_sms.c the function gsm411_rx_rl_data receives "struct gsm48_hdr
> *gh" as input then in very first line typecasts the pointer to "struct
> gsm411_rp_hdr *rp_data" to access its "data" field.
>
>> struct gsm411_rp_hdr *rp_data = (struct gsm411_rp_hdr*)&gh->data;

That's not what it does .... you need to either re-read that line or
re-read a book on C programming.

What is type casted is the pointer to gsm48_hdr data field. And that's
because the data field of the gsm48_hdr contains a gsm411_rp_hdr in
this case.


> Request you to correct and update suitably.

Well, I request you check your claims before making them ...


Cheers,

     Sylvain




More information about the baseband-devel mailing list