From: Zdenek Dohnal Date: Thu, 1 Jun 2023 10:04:00 +0000 (+0200) Subject: cups/string.c: Return if `size` is 0 (fixes CVE-2023-32324) X-Git-Tag: v2.4.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd8bc2d32589d1fd91fe1c0521be2a7c0462109e;p=thirdparty%2Fcups.git cups/string.c: Return if `size` is 0 (fixes CVE-2023-32324) --- diff --git a/cups/string.c b/cups/string.c index 00454203c3..b4fc12050c 100644 --- a/cups/string.c +++ b/cups/string.c @@ -1,6 +1,7 @@ /* * String functions for CUPS. * + * Copyright © 2023 by OpenPrinting. * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products. * @@ -730,6 +731,9 @@ _cups_strlcpy(char *dst, /* O - Destination string */ size_t srclen; /* Length of source string */ + if (size == 0) + return (0); + /* * Figure out how much room is needed... */