Skip to contentSkip to conversation

Fix for psplash segmentation fault

PATCH New Aws Ismail 1 participant 1 message Jul 17, 2012

lore
Share & tools
lore

Aws Ismail

author
#0 lore raw

PATCH 1/1 Fix for psplash segmentation fault

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.

meta/recipes-core/psplash/files/psplash-fix-angle-argv-segfault.patch new file +27 -0
new file mode 100644
index 0000000..797fe48
@@ -0,0 +1,27 @@
+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
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aws Ismail <[email protected]>
+
+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;
+       }
meta/recipes-core/psplash/psplash_git.bb +1 -0
index 0d88a60..06f8a9c 100644
@@ -11,6 +11,7 @@ PR = "r2"
 
 SRC_URI = "git://git.yoctoproject.org/${BPN};protocol=git \
            file://psplash-init \
+           file://psplash-fix-angle-argv-segfault.patch \
            ${SPLASH_IMAGES}"
 
 SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"