Skip to content
This repository has been archived by the owner on Sep 3, 2019. It is now read-only.

sufficient buffer space? #21

Closed
setharnold opened this issue Oct 3, 2018 · 1 comment
Closed

sufficient buffer space? #21

setharnold opened this issue Oct 3, 2018 · 1 comment

Comments

@setharnold
Copy link

Hello, I couldn't quickly find documentation on the ngx_http_map_uri_to_path() api, so please forgive the potentially naive question. Does the code properly verify that there's sufficient space at p to accept these writes?

Thanks

@eustas
Copy link
Owner

eustas commented Jul 17, 2019

Hello. The last parameter is "reserved" - i.e. how much extra space to allocate.
sizeof(".br") is 4 (including \0 terminator), so we request sizeof(".br") - 1 because terminator is not "extra" =)

@eustas eustas closed this as completed Jul 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants