d0716f4af5
[With hexadecimal color values now handled via their own routine, re-introduce the negative unsigned numbers fix.] strtoul() has a side effect that when given a string representing a negative number, it treats it as a high value hexadecimal. IOW, strtoul("-42", &val) sets val to 0xffffffd6. This could potentially result in unintended surprise behaviors. Catch this by using strtol() and then manually check for the negative value. This logic is modelled after Wayland's strtouint(). Note that this change unfortunately reduces the range of parseable numbers from [0,UINT_MAX] to [0,INT_MAX]. The current users of weston_config_section_get_uint() are anticipating numbers far smaller than either of these limits, so the change is believed to have no impact in practice. Also add a test case for negative numbers that catches this error condition. Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> |
||
---|---|---|
.. | ||
reference | ||
.gitignore | ||
bad-buffer-test.c | ||
buffer-count-test.c | ||
button-test.c | ||
config-parser-test.c | ||
devices-test.c | ||
event-test.c | ||
internal-screenshot-test.c | ||
internal-screenshot.ini | ||
ivi_layout-internal-test.c | ||
ivi_layout-test-plugin.c | ||
ivi_layout-test.c | ||
ivi-shell-app-test.c | ||
ivi-test.h | ||
keyboard-test.c | ||
matrix-test.c | ||
plugin-registry-test.c | ||
presentation-test.c | ||
roles-test.c | ||
setbacklight.c | ||
subsurface-test.c | ||
surface-global-test.c | ||
surface-screenshot.c | ||
surface-test.c | ||
text-test.c | ||
vertex-clip-test.c | ||
viewporter-test.c | ||
weston-test-client-helper.c | ||
weston-test-client-helper.h | ||
weston-test-runner.c | ||
weston-test-runner.h | ||
weston-test.c | ||
weston-tests-env | ||
xwayland-test.c |