Bash Version: 4.3.33
File: lib/sh/shquote.c
Function: sh_backslash_quote
Line: if (backslash_table[c] == 1)

Description
-----------
Variable "c" has signed integer type and may be negative (if "string" is
not only ASCII characters string). But "c" used as an index in
"backslash_table" array. This causes out of range error and produce
undefined behavior.

Possible solution
-----------------
Cast variable "c" to unsigned char type:
if (backslash_table[(unsigned char)c] == 1)


Reply via email to