diff options
-rw-r--r-- | process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |