Skip to content

Commit e1829a1

Browse files
committed
copy_arg: use src_end when checking for quoted chars
Same fix as af58de4. Reported by Reaxx.
1 parent bf2cbfc commit e1829a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/sudoers/editor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ copy_arg(const char *src, size_t len)
9898
if ((copy = malloc(len + 1)) != NULL) {
9999
sudoers_gc_add(GC_PTR, copy);
100100
for (dst = copy; src < src_end; ) {
101-
if (src[0] == '\\' && src[1] != '\0')
101+
if (*src == '\\' && src + 1 < src_end)
102102
src++;
103103
*dst++ = *src++;
104104
}

0 commit comments

Comments
 (0)