[CID 1125463] issue found by Coverity

Dennis Preiser <[email protected]> Fri, 8 Nov 2013 18:03:47 +0100
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Below a fix for 1125463. It might be possible that the following change
is already part of the fix for CID 1125403 (assigned to Urs):

-				strcat(sptr, name_buf);
+				strcat(sptr, BlankIfNull(name_buf));

Dennis

--SUOF0GtieIMvvwua
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="2013-11-08.diff"

diff -urp tin-2.1.4_r3/src/select.c tin-2.1.4_r4/src/select.c
--- tin-2.1.4_r3/src/select.c	2013-09-28 12:45:45.000000000 +0200
+++ tin-2.1.4_r4/src/select.c	2013-11-08 17:13:29.000000000 +0100
@@ -727,10 +727,10 @@ build_gline(
 
 				if (active_name2 && (active_name = wcspart(active_name2, groupname_len, TRUE)) != NULL) {
 					free(active_name2);
-					if ((name_buf = wchar_t2char(active_name)) != NULL)
-						free(active_name);
+					name_buf = wchar_t2char(active_name);
+					free(active_name);
 				}
-				strcat(sptr, name_buf);
+				strcat(sptr, BlankIfNull(name_buf));
 				FreeIfNeeded(name_buf);
 #else
 				if (tinrc.abbreviate_groupname)

--SUOF0GtieIMvvwua--