From 8baa84b767240d96691c9e5807092938b5a35edd Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Mon, 4 Nov 2013 15:22:38 +0200 Subject: [PATCH] android/client: Fix printing not NULL terminated strings Android passes not NULL terminated strings. --- android/client/textconv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/client/textconv.c b/android/client/textconv.c index 18f60eeba..4def3da19 100644 --- a/android/client/textconv.c +++ b/android/client/textconv.c @@ -253,7 +253,8 @@ char *btproperty2str(const bt_property_t *property) switch (property->type) { case BT_PROPERTY_BDNAME: case BT_PROPERTY_REMOTE_FRIENDLY_NAME: - sprintf(p, "%s", ((bt_bdname_t *) property->val)->name); + snprintf(p, property->len + 1, "%s", + ((bt_bdname_t *) property->val)->name); break; case BT_PROPERTY_BDADDR: -- 2.47.3