Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Global leak in "fp" #28

Merged
merged 1 commit into from

2 participants

@nicokruger

Simply made "fp" a var... fixes the global leak.

@felixge felixge merged commit 9eae39b into felixge:master
@felixge
Owner

Thanks, sorry for delay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 21, 2012
  1. @nicokruger

    Prevent global leak, closes #4

    nicokruger authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/paperboy.js
View
2  lib/paperboy.js
@@ -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)
Something went wrong with that request. Please try again.