lib/mangle: check for the NULL string argument
This patch prevents to call the function strlen() with a NULL string argument that leads to a segmentation fault. Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
This commit is contained in:
parent
3468dda9c3
commit
e368d0ad5d
|
@ -14,11 +14,13 @@ extern char *unmangle(const char *s, const char **end);
|
|||
|
||||
static inline void unmangle_string(char *s)
|
||||
{
|
||||
if (s)
|
||||
unmangle_to_buffer(s, s, strlen(s) + 1);
|
||||
}
|
||||
|
||||
static inline void unhexmangle_string(char *s)
|
||||
{
|
||||
if (s)
|
||||
unhexmangle_to_buffer(s, s, strlen(s) + 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue