]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cups/string.c: Return if `size` is 0 (fixes CVE-2023-32324)
authorZdenek Dohnal <zdohnal@redhat.com>
Thu, 1 Jun 2023 10:04:00 +0000 (12:04 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Thu, 1 Jun 2023 10:04:00 +0000 (12:04 +0200)
cups/string.c

index 00454203c3e96032ebee9066cb4a605804023d58..b4fc12050c8be0b04c744698784255759ca8acaf 100644 (file)
@@ -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...
   */