summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/process.c b/process.c
index 53b4ba5..91729c1 100644
--- a/process.c
+++ b/process.c
@@ -1286,7 +1286,8 @@ static int do_add (
protodata_len = strlen (protodata_hex);
if (protodata_len > 0)
{
- if (protodata_hex[0] == '"' && protodata_hex[protodata_len - 1] == '"')
+ if (protodata_len > 1 &&
+ protodata_hex[0] == '"' && protodata_hex[protodata_len - 1] == '"')
{
protodata = malloc (protodata_len - 1);
if (protodata)
@@ -1311,7 +1312,8 @@ static int do_add (
}
authdata_len = strlen (authdata_hex);
- if (authdata_hex[0] == '"' && authdata_hex[authdata_len - 1] == '"')
+ if (authdata_len > 1 &&
+ authdata_hex[0] == '"' && authdata_hex[authdata_len - 1] == '"')
{
authdata = malloc (authdata_len - 1);
if (authdata)