diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2011-05-30 22:39:56 +1000 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2011-05-30 22:39:56 +1000 |
commit | d6a076dae855bf0ff20aa0e5bb34dcc127a70a79 (patch) | |
tree | d671c1c83382467808c5e5e7768e2121dca08177 | |
parent | Fix a recent commit about "Set script as executable" (diff) |
Under some circumstances the "uri" variable in StartNamespaceDeclHandler could be NULL. We check this now.
-rw-r--r-- | src/expat_erl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/expat_erl.c b/src/expat_erl.c index 08f298e0..7831a906 100644 --- a/src/expat_erl.c +++ b/src/expat_erl.c @@ -132,6 +132,16 @@ void *erlXML_StartNamespaceDeclHandler(expat_data *d, int prefix_len; char *buf; + /* From the expat documentation: + "For a default namespace declaration (xmlns='...'), + the prefix will be null ... + ... The URI will be null for the case where + the default namespace is being unset." + + FIXME: I'm not quite sure what all that means */ + if (uri == NULL) + return NULL; + ei_x_encode_list_header(&xmlns_buf, 1); ei_x_encode_tuple_header(&xmlns_buf, 2); if (prefix) { |