projects
/
platform
/
upstream
/
ofono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
42deee7
)
smsutil: Add additional sanity check
author
Denis Kenzior
<denkenz@gmail.com>
Fri, 13 Feb 2015 15:59:59 +0000
(09:59 -0600)
committer
Denis Kenzior
<denkenz@gmail.com>
Fri, 13 Feb 2015 15:59:59 +0000
(09:59 -0600)
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.
src/smsutil.c
patch
|
blob
|
history
diff --git
a/src/smsutil.c
b/src/smsutil.c
index 74afb651e8e4185674330da771b9652cc7fea1bd..9406a8a8441fcab8d9c264fc011cd6ab77f78073 100644
(file)
--- a/
src/smsutil.c
+++ b/
src/smsutil.c
@@
-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);