From 1d3d38079c684d2a092deaae1dbeda0b82c6330d Mon Sep 17 00:00:00 2001 From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 11 May 2023 13:47:09 -0400 Subject: [PATCH] Wordlen should be a size_t, not an int text is always more than or equal to ptr, so it will never underflow. --- cgi-bin/help-index.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cgi-bin/help-index.c b/cgi-bin/help-index.c index 3da1010e6a..4a10235f33 100644 --- a/cgi-bin/help-index.c +++ b/cgi-bin/help-index.c @@ -851,7 +851,7 @@ help_load_file( off_t offset; /* File offset */ char quote; /* Quote character */ help_word_t *word; /* Current word */ - int wordlen; /* Length of word */ + size_t wordlen; /* Length of word */ if ((fp = cupsFileOpen(filename, "r")) == NULL) @@ -1136,9 +1136,9 @@ help_load_file( for (text = ptr, ptr ++; *ptr && isalnum(*ptr & 255); ptr ++); - wordlen = (int)(ptr - text); + wordlen = (size_t)(ptr - text); - memcpy(temp, text, (size_t)wordlen); + memcpy(temp, text, wordlen); temp[wordlen] = '\0'; ptr --; -- 2.47.2