From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Thu, 11 May 2023 17:47:09 +0000 (-0400) Subject: Wordlen should be a size_t, not an int X-Git-Tag: v2.4.3~21^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F684%2Fhead;p=thirdparty%2Fcups.git Wordlen should be a size_t, not an int text is always more than or equal to ptr, so it will never underflow. --- 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 --;