mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Change the pattern used to decide which NSE output characters to escape. It was
"[^%w%s%p]"; it's now "[^\t\r\n\032-\126]". The old pattern missed the form feed character, ASCII 12, which is illegal in XML.
This commit is contained in:
parent
2d018963ca
commit
40878cecf9
1 changed files with 5 additions and 1 deletions
|
|
@ -521,7 +521,11 @@ int process_mainloop(lua_State *L) {
|
|||
SCRIPT_ENGINE_TRY(process_getScriptId(thread, &sr));
|
||||
lua_getfield(thread, 2, "gsub");
|
||||
lua_pushvalue(thread, 2); // output FIXME
|
||||
lua_pushliteral(thread, "[^%w%s%p]");
|
||||
/* Escape any character outside the range 32-126 except for
|
||||
tab, carriage return, and line feed. This makes the
|
||||
string safe for screen display as well as XML (see
|
||||
section 2.2 of the XML spec). */
|
||||
lua_pushliteral(thread, "[^\t\r\n\040-\176]");
|
||||
lua_pushcclosure(thread, escape_char, 0);
|
||||
lua_call(thread, 3, 1);
|
||||
sr.set_output(lua_tostring(thread, -1));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue