Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protect against negative image dimensions #1927

Closed
springmeyer opened this issue Jun 26, 2013 · 1 comment
Closed

protect against negative image dimensions #1927

springmeyer opened this issue Jun 26, 2013 · 1 comment
Milestone

Comments

@springmeyer
Copy link
Member

Best case if you pass negative image dimensions you will get a bad_alloc when the unsigned arguments overflow. Worst case (I saw this on OS X a while back) your machine will lock up and bad_alloc never gets triggered.

We should protect and throw immediately before too much memory is requested.

springmeyer pushed a commit to mapnik/node-mapnik that referenced this issue Jun 26, 2013
PetrDlouhy pushed a commit to PetrDlouhy/mapnik that referenced this issue Aug 22, 2013
@springmeyer
Copy link
Member Author

re-opening, this may have regressed in 4f3521a#diff-3036b76b909346e1b67cb1136bdba99cL47

@springmeyer springmeyer reopened this Dec 5, 2014
@springmeyer springmeyer modified the milestones: Mapnik 3.x, Mapnik 2.3.0 Dec 5, 2014
springmeyer pushed a commit that referenced this issue Dec 5, 2014
artemp added a commit that referenced this issue Dec 19, 2014
* store image width and height in dimensions object
* allow specifying max_size for width and height (default 0xffff)
* throw if width or height are out of range - 0...max_size
@artemp artemp closed this as completed Dec 19, 2014
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

No branches or pull requests

2 participants