On 10/27/2014 09:51 AM, Jasper St. Pierre wrote:

        +                       if (!wl_strtol(since, NULL, 0, (long
        *)&version))


    This is baad. You cannot use the int version here, because in
    wl_strol you write sizeof(long) on the address
    of version and if sizeof(version) is smaller than sizeof(long) then
    you overwrite memory. I'm getting ugly SIGSEGV
    because of that.

That is annoying since it means an integer version must be provided as well (plus the annoyance that on some platforms it will not complain and work if you call the wrong function).

I think it would be better now to make this function return the value, and set errno on any error. Or make the error indicator an output parameter. I'd also dump the "base" parameter as it is not being used by anybody.

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to