Skip to content

page_name_is_good function#1

Open
yarolig wants to merge 2 commits intoOpenedHand:masterfrom
yarolig:master
Open

page_name_is_good function#1
yarolig wants to merge 2 commits intoOpenedHand:masterfrom
yarolig:master

Conversation

@yarolig
Copy link

@yarolig yarolig commented Sep 3, 2014

Fixed a dangerous bug in didiwiki.

@yarolig
Copy link
Author

yarolig commented Sep 4, 2014

I accidentally add an new feature to didiwiki.
Not it can access subdirectories.

I should check if it breaks anything.

page = http_request_get_query_string(req);

if (page && (unlink(page) > 0))
if (page && page_name_is_good(page) && (unlink(page) > 0))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would unlink() return a result >0 ? My manpage has:

RETURN VALUE
       On success, zero is returned.  On error, -1 is returned, and
       errno is set appropriately.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants