summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2006-04-09 13:45:31 +0000
committerDaniel Stone <daniel@fooishbar.org>2006-04-09 13:45:31 +0000
commitc3bc59c223ce4de8d6cce98c005a8f44bfa600c6 (patch)
treea146e7ee15fb05230da869c2aa92fc488bde842b
parent816a8db3264bc0752a8befd865b802ac4a2382ce (diff)
Coverity #265: Fix potential NULL dereference.
-rw-r--r--ChangeLog4
-rw-r--r--src/xkbout.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b65e2ed..37084ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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));