commit dcca2b1a6eab37639b39b6f53bce0c795181ea3f
parent c034ce1095039fcf204a804e31d67384229c992e
Author: wwp <subscript@free.fr>
Date: Thu, 13 Mar 2025 17:25:51 +0100
Fix CID 1220388: Out-of-bounds write (OVERRUN).
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/plugins/notification/notification_core.c b/src/plugins/notification/notification_core.c
@@ -662,22 +662,22 @@ gchar* notification_libnotify_sanitize_str(gchar *in)
out = 0;
while(*in) {
if(*in == '<') {
- if(out+4 > STR_MAX_LEN) break;
+ if(out+4 >= STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),"<",4);
in++; out += 4;
}
else if(*in == '>') {
- if(out+4 > STR_MAX_LEN) break;
+ if(out+4 >= STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),">",4);
in++; out += 4;
}
else if(*in == '&') {
- if(out+5 > STR_MAX_LEN) break;
+ if(out+5 >= STR_MAX_LEN) break;
memcpy(&(tmp_str[out]),"&",5);
in++; out += 5;
}
else {
- if(out+1 > STR_MAX_LEN) break;
+ if(out+1 >= STR_MAX_LEN) break;
tmp_str[out++] = *in++;
}
}