Mailing List Archive

nessus-plugins/scripts webmirror.nasl,1.36,1.37
Update of /usr/local/cvs/nessus-plugins/scripts
In directory raccoon.nessus.org:/tmp/cvs-serv79036

Modified Files:
webmirror.nasl
Log Message:
o Small optimization (use strstr() instead of manually looking for a char)
o Fixed a bug which would make the plugin access an array out of its boundaries



Index: webmirror.nasl
===================================================================
RCS file: /usr/local/cvs/nessus-plugins/scripts/webmirror.nasl,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- webmirror.nasl 13 Jan 2003 18:11:13 -0000 1.36
+++ webmirror.nasl 14 Jan 2003 17:38:41 -0000 1.37
@@ -963,18 +963,15 @@

if ((_dir_len <= 1) || (dir_url == 0)) return("/");

- for (_dir_idx=0; _dir_idx < _dir_len; _dir_idx = _dir_idx + 1)
+ t = strstr(_dir_copy, "?");

+ if(t)

{
- # remove everything after the query string
- if ("?" >< _dir_copy[_dir_idx])
- {
- _dir_copy = memcpy(mem_string:_dir_copy, mem_length:_dir_idx);
- _dir_len = strlen(_dir_copy);
- _dir_idx = _dir_len;
- }
+ _dir_copy = _dir_copy - t;

+ _dir_len = strlen(_dir_copy);

}
+

- for (_dir_idx=_dir_len; _dir_idx > 0; _dir_idx = _dir_idx - 1)
+ for (_dir_idx=_dir_len - 1; _dir_idx > 0; _dir_idx = _dir_idx - 1)

{