View | Details | Raw Unified | Return to bug 232267
Collapse All | Expand All

(-)mail/claws-mail/files/patch-src_plugins_notification_notification__core.c (+43 lines)
Line 0 Link Here
1
--- src/plugins/notification/notification_core.c.orig	2017-12-17 14:48:41.000000000 +0300
2
+++ src/plugins/notification/notification_core.c	2018-10-15 02:41:59.775686000 +0300
3
@@ -641,34 +641,34 @@
4
 }
5
 
6
 #ifdef HAVE_LIBNOTIFY
7
-#define STR_MAX_LEN 511
8
+#define STR_MAX_LEN 512
9
 /* Returns a newly allocated string which needs to be freed */
10
 gchar* notification_libnotify_sanitize_str(gchar *in)
11
 {
12
   gint out;
13
-  gchar tmp_str[STR_MAX_LEN+1];
14
+  gchar tmp_str[STR_MAX_LEN+8];
15
 
16
   if(in == NULL) return NULL;
17
 
18
   out = 0;
19
   while(*in) {
20
     if(*in == '<') {
21
-      if(out+4 > STR_MAX_LEN+1) break;
22
+      if(out+4 > STR_MAX_LEN) break;
23
       memcpy(&(tmp_str[out]),"&lt;",4);
24
       in++; out += 4;
25
     }
26
     else if(*in == '>') {
27
-      if(out+4 > STR_MAX_LEN+1) break;
28
+      if(out+4 > STR_MAX_LEN) break;
29
       memcpy(&(tmp_str[out]),"&gt;",4);
30
       in++; out += 4;
31
     }
32
     else if(*in == '&') {
33
-      if(out+5 > STR_MAX_LEN+1) break;
34
+      if(out+5 > STR_MAX_LEN) break;
35
       memcpy(&(tmp_str[out]),"&amp;",5);
36
       in++; out += 5;
37
     }
38
     else {
39
-      if(out+1 > STR_MAX_LEN+1) break;
40
+      if(out+1 > STR_MAX_LEN) break;
41
       tmp_str[out++] = *in++;
42
     }
43
   }

Return to bug 232267