Hi Niels,

On Friday, 7 October 2016, Niels Ole Salscheider <
[email protected]> wrote:

> Catch the error case separately. This fixes a few crashes on my computer.
>
> Signed-off-by: Niels Ole Salscheider <[email protected]
> <javascript:;>>
> ---
>  src/XListDev.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
>
> diff --git a/src/XListDev.c b/src/XListDev.c
> index f850cd0..d0c6bf2 100644
> --- a/src/XListDev.c
> +++ b/src/XListDev.c
> @@ -73,27 +73,27 @@ static int pad_to_xid(int base_size)
>      return ((base_size + padsize - 1)/padsize) * padsize;
>  }
>
> -static size_t
> -SizeClassInfo(xAnyClassPtr *any, size_t len, int num_classes)
> +static int
> +SizeClassInfo(xAnyClassPtr *any, size_t len, int num_classes, size_t
> *size)
>  {
> -    int size = 0;
>      int j;
> +    *size = 0;


No function should alter the contents of the arguments in case of an error.
For your other libXi patch one might want to fix the callers, if applicable.

If possible please mention a bug report/link or a bit more about how you
hit this. Wondering how it has gone unnoticed for so long.

That aside, nicely spotted !
Emil
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to