summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/script.c')
-rw-r--r--src/plugins/scripts/script.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c
index bcccfec89..8f36e2106 100644
--- a/src/plugins/scripts/script.c
+++ b/src/plugins/scripts/script.c
@@ -386,13 +386,16 @@ void *
script_str2ptr (const char *pointer_str)
{
long unsigned int value;
+ int rc;
if (!pointer_str || (pointer_str[0] != '0') || (pointer_str[1] != 'x'))
return NULL;
- sscanf (pointer_str + 2, "%lx", &value);
+ rc = sscanf (pointer_str + 2, "%lx", &value);
+ if ((rc != EOF) && (rc >= 1))
+ return (void *)value;
- return (void *)value;
+ return NULL;
}
/*