mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-04-10 11:21:52 +00:00
Avoid out of bound memory access
Value of idx is -1, if find_match_op returns -1. Later idx is used as index for accessing element of expr_dup causing our of bound memory access.
This commit is contained in:
parent
366c384bde
commit
e9fcca035b
@ -180,7 +180,7 @@ int compare(const char *expr) {
|
||||
idx = find_match_op(expr);
|
||||
mtype = get_match_type(expr);
|
||||
|
||||
if ((idx == 0) || mtype == -1) {
|
||||
if ((idx <= 0) || mtype == -1) {
|
||||
NORM_ERR("failed to parse compare string '%s'", expr);
|
||||
return -2;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user