Skip to content

Commit

Permalink
Merge pull request felixge#28 from nicokruger/master
Browse files Browse the repository at this point in the history
Global leak in "fp"
  • Loading branch information
felixge committed Jun 3, 2012
2 parents cda9b3c + ff3b545 commit 9eae39b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperboy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports.filepath = function (webroot, url) {
// Strip nullbytes (they can make us believe that the file extension isn't the one it really is)
url = url.replace(/\0/g, '');
// Append index.html if path ends with '/'
fp = path.normalize(path.join(webroot, (url.match(/\/$/)=='/') ? url+'index.html' : url));
var fp = path.normalize(path.join(webroot, (url.match(/\/$/)=='/') ? url+'index.html' : url));
// Sanitize input, make sure people can't use .. to get above webroot
if (webroot[webroot.length - 1] !== pathSep) webroot += pathSep;
if (fp.substr(0, webroot.length) != webroot)
Expand Down

0 comments on commit 9eae39b

Please sign in to comment.