From: Bryce Harrington Date: Fri, 8 Jul 2016 23:42:30 +0000 (-0700) Subject: wayland-client: Require base 10 for WAYLAND_SOCKET, explicitly X-Git-Tag: 1.12.91~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2cbdefc92ad012435e7e2d63ecb93243b445fc0;p=platform%2Fupstream%2Fwayland.git wayland-client: Require base 10 for WAYLAND_SOCKET, explicitly The third arg to strtol() specifies the base to assume for the number. When 0 is passed, as is currently done in wayland-client.c, hexadecimal and octal numbers are permitted and automatically detected and converted. I can find no indication that we would ever expect use of hexadecimal or octal for socket fd's. So be explicit about what base we're assuming here and avoid any potential surprises. Signed-off-by: Bryce Harrington Reviewed-by: Yong Bakos Reviewed-by: Daniel Stone --- diff --git a/src/wayland-client.c b/src/wayland-client.c index 03c087a..3d7361e 100644 --- a/src/wayland-client.c +++ b/src/wayland-client.c @@ -1006,7 +1006,7 @@ wl_display_connect(const char *name) if (connection) { int prev_errno = errno; errno = 0; - fd = strtol(connection, &end, 0); + fd = strtol(connection, &end, 10); if (errno != 0 || connection == end || *end != '\0') return NULL; errno = prev_errno;