Hi,

Sachiel went through my patch yesterday and suggested some minor changes to
avoid buffer overruns. I thought I'd submit a bigger patch later, but since
the older one's been committed to svn, I'm mailing it in now in the
interests of stability :)

Sorry for the trouble..

Thanks,
Amey
Index: trunk/E-MODULES-EXTRA/notification/src/e_mod_popup.c
===================================================================
--- trunk/E-MODULES-EXTRA/notification/src/e_mod_popup.c	(revision 39934)
+++ trunk/E-MODULES-EXTRA/notification/src/e_mod_popup.c	(working copy)
@@ -48,14 +48,21 @@ notification_popup_notify(E_Notification *n,
 
   if (replaces_id && (popup = _notification_popup_find(replaces_id))) 
     {
-      char nl[] = "\n";
+      char *nl = "\n";
       e_notification_ref(n);
       if (popup->notif)
       {
         char *body_old = e_notification_body_get(popup->notif);
-        char *body_new= e_notification_body_get(n);
-        body_new = strcat(strcat(body_old, nl), body_new);
-        e_notification_body_set(n, body_new);
+        char *body_new = e_notification_body_get(n);
+        char *body_final = (char*)alloca((strlen(body_old)+strlen(body_new)+2)*sizeof(char));
+        if (body_final!=0)
+        {
+          body_final = strcpy(body_final, body_old);
+          body_final = strcat(body_final, nl);
+          body_final = strcat(body_final, body_new);
+          e_notification_body_set(n, body_final);
+        }
+        else e_notification_body_set(n, "too large");
         e_notification_unref(popup->notif);
       }
       popup->notif = n;
------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to