All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aws Ismail <aws.ismail@windriver.com>
To: <yocto@yoctoproject.org>
Subject: Re: [PATCH] Fix for psplash segmentation fault
Date: Mon, 9 Jul 2012 15:49:26 -0400	[thread overview]
Message-ID: <4FFB35C6.50306@windriver.com> (raw)
In-Reply-To: <4FF75054.7080006@windriver.com>

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@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@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@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto




  parent reply	other threads:[~2012-07-09 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 20:53 [PATCH] Fix for psplash segmentation fault Aws Ismail
2012-07-06 20:54 ` Aws Ismail
2012-07-09 19:49 ` Aws Ismail [this message]
2012-07-16 16:32 ` Saul Wold
  -- strict thread matches above, loose matches on Subject: below --
2012-07-17 16:04 Aws Ismail
2012-07-17 16:37 Aws Ismail

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FFB35C6.50306@windriver.com \
    --to=aws.ismail@windriver.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.