pidgin: f5b642dc: Bounds check an OSCAR normalization. (E...

elb at pidgin.im elb at pidgin.im
Thu Aug 11 12:42:12 EDT 2011


----------------------------------------------------------------------
Revision: f5b642dc7bad17d2bddc82bfe1f995f7ee981d30
Parent:   7a7537a58570b401e5101a0f066f4e394b08661b
Author:   elb at pidgin.im
Date:     08/11/11 12:17:29
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f5b642dc7bad17d2bddc82bfe1f995f7ee981d30

Changelog: 

Bounds check an OSCAR normalization.  (EFF)

Changes against parent 7a7537a58570b401e5101a0f066f4e394b08661b

  patched  libpurple/protocols/oscar/oscar.c

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	c358306cfcf3155198b4f084863a04e7d9e3dcda
+++ libpurple/protocols/oscar/oscar.c	8d2cc45405a2fa31fb08c24aac86d5915992ab7b
@@ -5651,7 +5651,10 @@ oscar_normalize(const PurpleAccount *acc
 
 	tmp1 = g_utf8_strdown(buf, -1);
 	tmp2 = g_utf8_normalize(tmp1, -1, G_NORMALIZE_DEFAULT);
-	strcpy(buf, tmp2);
+	if (strlen(tmp2) > sizeof(buf) - 1) {
+		purple_debug_error("oscar", "normalized string exceeds buffer length!\n");
+	}
+	g_strlcpy(buf, tmp2, sizeof(buf));
 	g_free(tmp2);
 	g_free(tmp1);
 


More information about the Commits mailing list