]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
Fix coverity issue 3.
authorZdenek Dohnal <zdohnal@redhat.com>
Wed, 15 Feb 2023 17:40:55 +0000 (18:40 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Wed, 15 Feb 2023 17:40:55 +0000 (18:40 +0100)
Ensure we have NULL terminator

filter/foomatic-rip/options.c

index 41bd9c6e04aace62763b507f556fe3828dae5d5b..bad833bc11df2ffcbabc7b8ff9dc3cb58b197b1b 100644 (file)
@@ -2261,9 +2261,8 @@ ppd_supports_pdf()
   // line
   if (startswith(cmd, "gs"))
   {
-    strncpy(cmd_pdf, cmd, 4096);
-    if (strlen(cmd) > 4095)
-      cmd_pdf[4095] = '\0';
+    strncpy(cmd_pdf, cmd, 4095);
+    cmd_pdf[4095] = '\0';
     return (1);
   }