diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-05 03:01:59 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-24 10:23:44 +0100 |
commit | 2c5a4ad1e7b10a9c6a900932b8690a81811fd84e (patch) | |
tree | a72eee3ddc28b6b0d4b151b47458d5d3476cfa21 | |
parent | 53b223551687397986d55bfbf34009663cec217a (diff) | |
download | ratpoison-2c5a4ad1e7b10a9c6a900932b8690a81811fd84e.zip |
In history_add_upto make sure we don't dereference a NULL pointer;
-rw-r--r-- | src/history.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/history.c b/src/history.c index 8ba2c53..915889a 100644 --- a/src/history.c +++ b/src/history.c @@ -141,7 +141,7 @@ history_add_upto (int history_id, const char *item, size_t max) if (defaults.history_compaction && max != INT_MAX) { struct list_head *l; - for (l = h->head.prev ; l != &h->head ; l = l->prev) { + for (l = h->head.prev ; l && l != &h->head ; l = l->prev) { if (!strcmp (list_entry(l, struct history_item, node)->line, item)) { list_del (l); list_add_tail (l, &h->head); |