aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Crosby <dave@dafyddcrosby.com>2015-07-26 06:12:39 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-08-11 12:59:28 +0000
commit66036b0db62e8b9bdeb575109becc31fa3eff88a (patch)
tree17ee2ecab281cfb16d0a622d7adf6ae4ce385cfa
parentAdjust UFclose to remove false positive of CWE-481 (diff)
downloadw3m-66036b0db62e8b9bdeb575109becc31fa3eff88a.tar.gz
w3m-66036b0db62e8b9bdeb575109becc31fa3eff88a.zip
Check for presence of prevl before using
-rw-r--r--buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/buffer.c b/buffer.c
index f67dd26..3b2352a 100644
--- a/buffer.c
+++ b/buffer.c
@@ -761,8 +761,10 @@ readBufferCache(Buffer *buf)
}
#endif
}
- buf->lastLine = prevl;
- buf->lastLine->next = NULL;
+ if (prevl) {
+ buf->lastLine = prevl;
+ buf->lastLine->next = NULL;
+ }
fclose(cache);
unlink(buf->savecache);
buf->savecache = NULL;