pidgin: d8883119: Null-terminate this string explicitly to...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Fri Oct 2 23:40:43 EDT 2009


-----------------------------------------------------------------
Revision: d88831199cb010e3856ff07fccd05fc6be6b1e72
Ancestor: 21cd61e54ce2a5a0e0ae521fc1cd51e2570586d2
Author: darkrain42 at pidgin.im
Date: 2009-10-03T03:25:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d88831199cb010e3856ff07fccd05fc6be6b1e72

Modified files:
        libpurple/dnssrv.c

ChangeLog: 

Null-terminate this string explicitly to avoid valgrind complaining.

-------------- next part --------------
============================================================
--- libpurple/dnssrv.c	79c499e88003feb8282776bee5347cd1589f6aa5
+++ libpurple/dnssrv.c	5cd685bde659620c50c1146fff1f7585b29cbae8
@@ -674,6 +674,7 @@ purple_srv_resolve(const char *protocol,
 
 	internal_query.type = T_SRV;
 	strncpy(internal_query.query, query, 255);
+	internal_query.query[255] = '\0';
 
 	if (write(in[1], &internal_query, sizeof(internal_query)) < 0)
 		purple_debug_error("dnssrv", "Could not write to SRV resolver\n");


More information about the Commits mailing list