From 5f73860fe81762e53c48db5c0a61bcb0a519ec02 Mon Sep 17 00:00:00 2001 From: Radoslaw Jablonski Date: Mon, 10 Oct 2011 09:22:38 +0200 Subject: [PATCH] obexd: Add check for empty string in vcard_printf_fullname If tag value is empty there is possibility to quickly create empty tag without entering to rest of the logic. Checking for empty parameter at the begining is included basicaly in every print tag function in code - here somehow was missing. --- obexd/plugins/vcard.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/obexd/plugins/vcard.c b/obexd/plugins/vcard.c index f1d9edc50..c0a33cb50 100644 --- a/obexd/plugins/vcard.c +++ b/obexd/plugins/vcard.c @@ -392,6 +392,11 @@ static void vcard_printf_fullname(GString *vcards, uint8_t format, { char field[LEN_MAX]; + if (!text || strlen(text) == 0) { + vcard_printf(vcards, "FN:"); + return; + } + if (select_qp_encoding(format, text, NULL)) { vcard_qp_print_encoded(vcards, "FN", text, NULL); return; -- 2.47.3