DevHeads.net

Review Request: KJS: fix behaviour on allocation errors

Review request for kdelibs.

Description
The KJS allocator will likely crash with a 0-deref on allocation errors. The exact behaviour will also depend on the platform, e.g. a Un*x platform without posix_memalign() will have MAP_FAILED as the pointer used for calculations (which is (void*)-1), other will have 0.

This will make the allocator have a sane default behaviour: just return 0.

Diffs
kjs/collector.cpp 70e4757

Diff: <a href="http://git.reviewboard.kde.org/r/104960/diff/" title="http://git.reviewboard.kde.org/r/104960/diff/">http://git.reviewboard.kde.org/r/104960/diff/</a>

Testing

Thanks,

Rolf Eike Beer

Comments

Re: Review Request 104960: KJS: fix behaviour on allocation erro

By Rolf Eike Beer at 02/07/2016 - 12:29

(Updated Feb. 7, 2016, 5:29 nachm.)

Status
This change has been discarded.

Review request for kdelibs.

Repository: kdelibs

Description
The KJS allocator will likely crash with a 0-deref on allocation errors. The exact behaviour will also depend on the platform, e.g. a Un*x platform without posix_memalign() will have MAP_FAILED as the pointer used for calculations (which is (void*)-1), other will have 0.

This will make the allocator have a sane default behaviour: just return 0.

Diffs
kjs/collector.cpp 70e4757

Diff: <a href="https://git.reviewboard.kde.org/r/104960/diff/" title="https://git.reviewboard.kde.org/r/104960/diff/">https://git.reviewboard.kde.org/r/104960/diff/</a>

Testing

Thanks,

Rolf Eike Beer