[yocto] [PATCH] Fix for psplash segmentation fault

Aws Ismail aws.ismail at windriver.com
Mon Jul 9 12:49:26 PDT 2012


Hi all,

This is a follow-up on the fix I sent recently for psplash. I'd
appreciate any comments.

Thanks

Aws Ismail

====================================================================
Fix psplash segmentation fault

This fixes the segmentation fault when calling:
psplash -a

The -a option requires a rotation angle to be given
and if it is missing then the user is shown the correct usage.

From: git://git.yoctoproject.org/psplash

Signed-off-by: Aws Ismail <aws.ismail at windriver.com>

--------------------------------------------------------------------
diff --git a/psplash.c b/psplash.c
index 0158628..09cf0d0 100644
--- a/psplash.c
+++ b/psplash.c
@@ -219,7 +219,7 @@ main (int argc, char** argv)

        if (!strcmp(argv[i],"-a") || !strcmp(argv[i],"--angle"))
          {
-         if (++i > argc) goto fail;
+         if (++i >= argc) goto fail;
           angle = atoi(argv[i]);
           continue;
         }



On 07/06/2012 04:53 PM, Aws Ismail wrote:
> Fix segmentation fault when passing -a without angle value.
>
> When psplash -a is called instead of psplash -a<angle value>
> it will segmentation fault calling out of bound argv[].
>
> git://git.yoctoproject.org/psplash
>
> Signed-of-by: Aws Ismail<aws.ismail at windriver.com>
>
> -----------------------------------------------------------------
>
> diff --git a/psplash.c b/psplash.c
> index 0158628..09cf0d0 100644
> --- a/psplash.c
> +++ b/psplash.c
> @@ -219,7 +219,7 @@ main (int argc, char** argv)
>
>        if (!strcmp(argv[i],"-a") || !strcmp(argv[i],"--angle"))
>          {
> -         if (++i > argc) goto fail;
> +         if (++i >= argc) goto fail;
>           angle = atoi(argv[i]);
>           continue;
>         }
>
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto





More information about the yocto mailing list