{"action":"reopened","issue":{"number":11,"created_at":"2011-10-07T02:19:37Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I have a crash which I've traced to modhtp_htp_request_headers:\r\n\r\n(1)     /* Update the hostname. */\r\n    if (tx->parsed_uri != NULL) {\r\n        itx->hostname = (const char *)bstr_util_strdup_to_c(tx->parsed_uri->hostname);\r\n    }\r\n\r\nI have a case where tx->parsed_uri is non-null but fields are unset, with tx->parsed_uri being an empty string (this looks like a bug elsewhere, but I haven't figured out where parsed_uri is set).  The above code then sets itx->hostname to NULL.\r\n\r\nThis NULL string is then dereferenced in ib_state_notify_request_headers, with at the top of the backtrace:\r\n#0  __strlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen.S:99\r\n#1  0x00744d4f in ib_context_siteloc_chooser (ctx=0xb2bb0748, \r\n    type=IB_CTYPE_TX, ctxdata=0x8981fe8, cbdata=0xb2b8f1e8) at engine.c:2049\r\n#2  0x00741402 in _ib_context_get (ib=0xb2b8af80, type=IB_CTYPE_TX, \r\n    data=0x8981fe8, pctx=0x8981ff8) at engine.c:98\r\n#3  0x00743393 in ib_state_notify_request_headers (ib=0xb2b8af80, tx=0x8981fe8)\r\n    at engine.c:1200\r\n#4  0x007c9e2f in modhtp_htp_request_headers (connp=0x896c950) at htp.c:347\r\n","comments":3,"title":"modhtp converts empty string to NULL pointer, then dereferences it","updated_at":"2011-10-11T18:35:06Z","url":"https://api.github.com/repos/ironbee/ironbee/issues/11","id":1839952,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/0ceb46b0aec63a5236b72e2ced0d3b52?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/niq","id":983664,"login":"niq"},"html_url":"https://github.com/ironbee/ironbee/issues/11","labels":[],"state":"open"},"legacy":{"number":11,"action":"reopened","issue":1839952}}