From: Aizal Khan Date: Sun, 5 Jul 2026 08:19:07 +0000 (+0530) Subject: fix out-of-bounds read in rastertolabel delta-row compare X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1644%2Fhead;p=thirdparty%2Fcups.git fix out-of-bounds read in rastertolabel delta-row compare Signed-off-by: Aizal Khan --- diff --git a/filter/rastertolabel.c b/filter/rastertolabel.c index 0434d159e8..bee0f2aa8e 100644 --- a/filter/rastertolabel.c +++ b/filter/rastertolabel.c @@ -953,8 +953,8 @@ PCLCompress(unsigned char *line, /* I - Line to compress */ * The seed buffer is valid, so compare against it... */ - while (*line_ptr == *seed && - line_ptr < line_end) + while (line_ptr < line_end && + *line_ptr == *seed) { line_ptr ++; seed ++; @@ -971,8 +971,8 @@ PCLCompress(unsigned char *line, /* I - Line to compress */ start = line_ptr; count = 0; - while (*line_ptr != *seed && - line_ptr < line_end && + while (line_ptr < line_end && + *line_ptr != *seed && count < 8) { line_ptr ++;