aboutsummaryrefslogtreecommitdiffstats
path: root/history.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2021-03-30 11:15:07 +0000
committerTatsuya Kinoshita <tats@debian.org>2021-03-30 11:15:07 +0000
commit1a9bcdf202f062e89bb73aa9b0bfe6e3c9b4d5d9 (patch)
treea7894c50d982205760ff7f15f20a9da55a240d0a /history.c
parentUpdate ChangeLog (diff)
downloadw3m-1a9bcdf202f062e89bb73aa9b0bfe6e3c9b4d5d9.tar.gz
w3m-1a9bcdf202f062e89bb73aa9b0bfe6e3c9b4d5d9.zip
Treat textlist item number as int instead of short
cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838952
Diffstat (limited to 'history.c')
-rw-r--r--history.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/history.c b/history.c
index f2a00b4..2ba0400 100644
--- a/history.c
+++ b/history.c
@@ -119,7 +119,8 @@ unshiftHist(Hist *hist, char *ptr)
{
HistItem *item;
- if (hist == NULL || hist->list == NULL)
+ if (hist == NULL || hist->list == NULL ||
+ hist->list->nitem >= HIST_LIST_MAX)
return NULL;
item = (HistItem *)newListItem((void *)allocStr(ptr, -1),
(ListItem *)hist->list->first, NULL);
@@ -137,7 +138,8 @@ pushHist(Hist *hist, char *ptr)
{
HistItem *item;
- if (hist == NULL || hist->list == NULL)
+ if (hist == NULL || hist->list == NULL ||
+ hist->list->nitem >= HIST_LIST_MAX)
return NULL;
item = (HistItem *)newListItem((void *)allocStr(ptr, -1),
NULL, (ListItem *)hist->list->last);
@@ -157,7 +159,8 @@ pushHashHist(Hist *hist, char *ptr)
{
HistItem *item;
- if (hist == NULL || hist->list == NULL)
+ if (hist == NULL || hist->list == NULL ||
+ hist->list->nitem >= HIST_LIST_MAX)
return NULL;
item = getHashHist(hist, ptr);
if (item) {