diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-01 22:27:36 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-01 22:27:36 -0800 |
commit | 1e236565459d10c7ad85ebed285d2acfc4b15b69 (patch) | |
tree | bef4d76b928615c02dbbd5063142d0e80d1ffc1e | |
parent | 15d326027827c168511f923e72c64e2131515e19 (diff) |
assert to avoid a NULL dereference
Bitmap.c:1246:8: warning: Dereference of null pointer
**str = '\0';
~~~~~~^~~~~~
1 warning generated.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
-rw-r--r-- | Bitmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -41,6 +41,7 @@ from The Open Group. #include "BitmapP.h" #include "Bitmap.h" +#include <assert.h> #include <stdio.h> #include <math.h> @@ -1238,6 +1239,8 @@ BWGetFilepath(Widget w, String *str) String end; *str = XtNewString(BW->bitmap.filename); + assert(*str); + end = strrchr(*str, '/'); if (end) |