Commit 483a3ed0 authored by Naman Dixit's avatar Naman Dixit

FIxed zero keys and values

parent b3f73a53
...@@ -158,6 +158,11 @@ XML_Message xmlParseMessage (Char *xml) { ...@@ -158,6 +158,11 @@ XML_Message xmlParseMessage (Char *xml) {
key_len++; key_len++;
} }
if (key_len == 0) {
error_message = "Empty key";
goto parse_failed;
}
PARSE_CHAR('<'); PARSE_CHAR('<');
PARSE_SPACE(); PARSE_SPACE();
PARSE_CHAR('/'); PARSE_CHAR('/');
...@@ -248,6 +253,11 @@ XML_Message xmlParseMessage (Char *xml) { ...@@ -248,6 +253,11 @@ XML_Message xmlParseMessage (Char *xml) {
value_len++; value_len++;
} }
if (value_len == 0) {
error_message = "Empty value";
goto parse_failed;
}
PARSE_CHAR('<'); PARSE_CHAR('<');
PARSE_SPACE(); PARSE_SPACE();
PARSE_CHAR('/'); PARSE_CHAR('/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment