From d152384a9fc6337abc7cec0a5767577653aab9f0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 8 Oct 2012 15:45:43 +0200 Subject: [PATCH] z3950_client: fix string handling for init diagnostics in the case where addinfo was absent. --- src/filter_z3950_client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filter_z3950_client.cpp b/src/filter_z3950_client.cpp index d4f78a9..a42fb61 100644 --- a/src/filter_z3950_client.cpp +++ b/src/filter_z3950_client.cpp @@ -238,9 +238,10 @@ void yf::Z3950Client::Assoc::fixup_init(ODR odr, Z_InitResponse *initrs) odr, (oaddinfo ? strlen(oaddinfo) : 0) + 20 + m_host.length()); + *naddinfo = '\0'; if (oaddinfo && *oaddinfo) { - strcpy(naddinfo, oaddinfo); + strcat(naddinfo, oaddinfo); strcat(naddinfo, " "); } strcat(naddinfo, "(backend="); -- 1.7.10.4