diff options
author | Daniel Stone <daniel@fooishbar.org> | 2006-04-09 13:45:31 +0000 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2006-04-09 13:45:31 +0000 |
commit | c3bc59c223ce4de8d6cce98c005a8f44bfa600c6 (patch) | |
tree | a146e7ee15fb05230da869c2aa92fc488bde842b | |
parent | 816a8db3264bc0752a8befd865b802ac4a2382ce (diff) |
Coverity #265: Fix potential NULL dereference.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/xkbout.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -3,6 +3,10 @@ * src/xkbtext.c: Coverity #776, 777: Fix memory leaks. + * src/xkbout.c: + Coverity #774: Fix memory leak. + Coverity #265: Fix potential NULL dereference. + 2006-04-07 Daniel Stone <daniel@freedesktop.org> * src/maprules.c: diff --git a/src/xkbout.c b/src/xkbout.c index a5593fa..e5ada51 100644 --- a/src/xkbout.c +++ b/src/xkbout.c @@ -778,7 +778,7 @@ int dfltKeyColor = 0; fprintf(file," angle= %s;\n", XkbGeomFPText(s->angle,XkbXKBFile)); } - for (i=0,row=s->rows;i<s->num_rows;i++,row++) { + for (i=0,row=s->rows;row&&i<s->num_rows;i++,row++) { fprintf(file," row {\n"); fprintf(file," top= %s;\n", XkbGeomFPText(row->top,XkbXKBFile)); |