mirror of git://git.sysmocom.de/ofono
smsutil: Add additional sanity check
We make sure that after performing the UTF8 -> GSM conversion, the number of GSM bytes is not greater than 11, which is the maximum payload.
This commit is contained in:
parent
42deee76a1
commit
e2398b4dfa
|
@ -555,6 +555,11 @@ gboolean sms_encode_address_field(const struct sms_address *in, gboolean sc,
|
|||
if (gsm == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (written > 11) {
|
||||
g_free(gsm);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
r = pack_7bit_own_buf(gsm, written, 0, FALSE, &packed, 0, p);
|
||||
|
||||
g_free(gsm);
|
||||
|
|
Loading…
Reference in New Issue