summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-11-10 18:42:03 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-11-10 18:42:03 +0000
commit5c7809f4031c03ba1fd18c2c9f5a5438525938a5 (patch)
treede4b2c852ee0d905bfe48860e7625bb7dec0b7ce /hcid
parent344e38a9616a11072a123dacb70daf6ab69d5270 (diff)
hcid: textfile_put value must be null terminated
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-sdp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hcid/dbus-sdp.c b/hcid/dbus-sdp.c
index e4be89bc..73dfcbe7 100644
--- a/hcid/dbus-sdp.c
+++ b/hcid/dbus-sdp.c
@@ -364,11 +364,9 @@ static int sdp_store_record(const char *src, const char *dst, uint32_t handle, u
create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
- snprintf(key, sizeof(key), "%s#%08X", dst, handle);
+ snprintf(key, sizeof(key), "%17s#%08X", dst, handle);
- value = g_malloc(size * 2 + 1);
-
- value[0] = '\0';
+ value = g_malloc0(size * 2 + 1);
for (i = 0; i < size; i++)
sprintf(value + (i * 2), "%02X", buf[i]);