[Pkg-wmaker-commits] [fookb] 09/17: fookb: Fix error handling when reading XPM files.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Sun Sep 10 14:35:25 UTC 2017
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository fookb.
commit 905308affbddb5e95595afe8b5a24a0f3a35573e
Author: Doug Torrance <dtorrance at piedmont.edu>
Date: Sat Sep 9 21:24:25 2017 -0400
fookb: Fix error handling when reading XPM files.
Previously, we would try and read the width and height of images read from
an XPM file *before* doing any error handling to determine whether we
successfully read the file in the first place. If there had been an error,
then there would be a segfault.
---
images.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/images.c b/images.c
index d052a30..8f24949 100644
--- a/images.c
+++ b/images.c
@@ -38,6 +38,9 @@ static int get_one_image(char *name, int index, Display *dpy)
foo = XpmReadFileToImage(dpy, name, &stupid_picture[index],
NULL, NULL);
+ if (foo < 0)
+ return foo;
+
if (0 == w) {
w = stupid_picture[index]->width;
if (0 == w) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/fookb.git
More information about the Pkg-wmaker-commits
mailing list