mirror of https://github.com/OpenVPN/openvpn-gui
Check pointer is not NULL before passing to strlen
Signed-off-by: Selva Nair <selva.nair@gmail.com>pull/486/head
parent
6271d2f674
commit
2cc5788367
3
misc.c
3
misc.c
|
@ -171,7 +171,6 @@ char *
|
|||
escape_string(const char *input)
|
||||
{
|
||||
char *out = strdup(input);
|
||||
int len = strlen(out);
|
||||
const char *esc = "\'\"\\ ";
|
||||
|
||||
if (!out)
|
||||
|
@ -180,6 +179,8 @@ escape_string(const char *input)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int len = strlen(out);
|
||||
|
||||
for (int pos = 0; pos < len; ++pos)
|
||||
{
|
||||
if (strchr(esc, out[pos]))
|
||||
|
|
Loading…
Reference in New Issue