summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNaina Nalluri <nnalluri@codeaurora.org>2016-05-04 14:03:40 -0700
committerSteve Kondik <steve@cyngn.com>2016-07-16 02:40:45 -0700
commit24443ade2360760e9c357a98c3d9e1675dafd25c (patch)
treed3fffae7604aea562afc3131579fc963b2bd522f
parentbc3001780c8aa363a4651a837d0e934965d97f14 (diff)
downloadandroid_hardware_ril-24443ade2360760e9c357a98c3d9e1675dafd25c.tar.gz
android_hardware_ril-24443ade2360760e9c357a98c3d9e1675dafd25c.tar.bz2
android_hardware_ril-24443ade2360760e9c357a98c3d9e1675dafd25c.zip
ril: Fix kw banned functionsstable/cm-13.0-caf-ZNH5Y
Fix KW banned functions Change-Id: I052ac3065cc476dac24f5db390deda15ae584717 CRs-Fixed: 1011770
-rw-r--r--libril/RilSapSocket.cpp2
-rw-r--r--reference-ril/reference-ril.c16
2 files changed, 11 insertions, 7 deletions
diff --git a/libril/RilSapSocket.cpp b/libril/RilSapSocket.cpp
index d98971c..94d9894 100644
--- a/libril/RilSapSocket.cpp
+++ b/libril/RilSapSocket.cpp
@@ -250,7 +250,7 @@ void log_hex(const char *who, const uint8_t *buffer, int length) {
int per_line = 0;
do {
- dest += sprintf(out, "%8.8s [%8.8x] ", who, source);
+ dest += snprintf(out, sizeof(out), "%8.8s [%8.8x] ", who, source);
for(; source < length && dest_len - dest > 3 && per_line < BYTES_PER_LINE; source++,
per_line ++) {
out[dest++] = HEX_HIGH(buffer[source]);
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c
index 07482c8..caa5254 100644
--- a/reference-ril/reference-ril.c
+++ b/reference-ril/reference-ril.c
@@ -543,23 +543,27 @@ static void requestOrSendDataCallList(RIL_Token *t)
err = at_tok_nextstr(&line, &out);
if (err < 0)
goto error;
- responses[i].type = alloca(strlen(out) + 1);
- strcpy(responses[i].type, out);
+
+ int type_size = strlen(out) + 1;
+ responses[i].type = alloca(type_size);
+ strlcpy(responses[i].type, out, type_size);
// APN ignored for v5
err = at_tok_nextstr(&line, &out);
if (err < 0)
goto error;
- responses[i].ifname = alloca(strlen(PPP_TTY_PATH) + 1);
- strcpy(responses[i].ifname, PPP_TTY_PATH);
+ int ifname_size = strlen(PPP_TTY_PATH) + 1;
+ responses[i].ifname = alloca(ifname_size);
+ strlcpy(responses[i].ifname, PPP_TTY_PATH, ifname_size);
err = at_tok_nextstr(&line, &out);
if (err < 0)
goto error;
- responses[i].addresses = alloca(strlen(out) + 1);
- strcpy(responses[i].addresses, out);
+ int addresses_size = strlen(out) + 1;
+ responses[i].addresses = alloca(addresses_size);
+ strlcpy(responses[i].addresses, out, addresses_size);
{
char propValue[PROP_VALUE_MAX];