diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-09-15 12:11:08 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-09-15 12:11:08 -0500 |
commit | c97489a16113c95275c4ea60f3af3ff65a04466c (patch) | |
tree | d14b3601ac8bbb1def1bb01fc7b0f42fc3fbddd3 | |
parent | 41a55beef311182b58822061b14be5e478bcc932 (diff) | |
download | ofono-c97489a16113c95275c4ea60f3af3ff65a04466c.tar.bz2 |
ussd: Tweak buffer size
-rw-r--r-- | drivers/atmodem/ussd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c index 332e07f1..f38dfd04 100644 --- a/drivers/atmodem/ussd.c +++ b/drivers/atmodem/ussd.c @@ -72,9 +72,9 @@ static const unsigned char *ucs2_gsm_to_packed(const char *content, unsigned char *gsm; long written; unsigned char *packed; - unsigned char buf[182 * 4]; /* 182 USSD chars * 2 (UCS2) * 2 (hex) */ + unsigned char buf[182 * 2]; /* 182 USSD chars * 2 (UCS2) */ - if (strlen(content) > sizeof(buf)) + if (strlen(content) > sizeof(buf) * 2) /* Hex, 2 chars / byte */ return NULL; decoded = decode_hex_own_buf(content, -1, &len, 0, buf); |