libpaper-2.1.1-6.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-457): [#def2]
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c:102: warning[uninitvar]: Uninitialized variable: *saveptr
#  100|   static char *gettok(char *p, char **saveptr) {
#  101|       if (p == NULL)
#  102|->         p = *saveptr;
#  103|       /* Skip leading space. */
#  104|       for (; isspace(*p); p++)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c: scope_hint: In function 'gettok'
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c:102:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*saveptr'
#  100|   static char *gettok(char *p, char **saveptr) {
#  101|       if (p == NULL)
#  102|->         p = *saveptr;
#  103|       /* Skip leading space. */
#  104|       for (; isspace(*p); p++)

Error: CLANG_WARNING: [#def4]
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c:102:11: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  100|   static char *gettok(char *p, char **saveptr) {
#  101|       if (p == NULL)
#  102|->         p = *saveptr;
#  103|       /* Skip leading space. */
#  104|       for (; isspace(*p); p++)

Error: CLANG_WARNING: [#def5]
libpaper-2.1.1-build/libpaper-2.1.1/lib/libpaper.c:217:21: warning[deadcode.DeadStores]: Value stored to 'prev' is never read
#  215|                       prev->next = p;
#  216|                   else /* This is the first item. */
#  217|->                     prev = *papers_list = p;
#  218|               } else
#  219|                   ret = PAPER_MISSING_FIELD;

Error: CPPCHECK_WARNING: [#def6]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: COMPILER_WARNING: [#def7]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c: scope_hint: In function 'careadlinkat'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c:178:5: warning[-Wcpp]: #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
#  178 |    #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
#      |     ^~~~~~~
#  176|        shrinking realloc.  */
#  177|     #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
#  178|->    #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
#  179|      #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
#  180|     #endif

Error: COMPILER_WARNING: [#def8]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c:179:5: warning[-Wcpp]: #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
#  179 |    #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
#      |     ^~~~~~~
#  177|     #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
#  178|      #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
#  179|->    #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
#  180|     #endif
#  181|     char stack_buf[STACK_BUF_SIZE];

Error: COMPILER_WARNING (CWE-562): [#def9]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c:182:10: warning[-Wreturn-local-addr]: function may return address of local variable
#  182 |   return readlink_stk (fd, filename, buffer, buffer_size, alloc,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  183 |                        preadlinkat, stack_buf);
#      |                        ~~~~~~~~~~~~~~~~~~~~~~~
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/careadlinkat.c:181:8: note: declared here
#  181 |   char stack_buf[STACK_BUF_SIZE];
#      |        ^~~~~~~~~
#  180|     #endif
#  181|     char stack_buf[STACK_BUF_SIZE];
#  182|->   return readlink_stk (fd, filename, buffer, buffer_size, alloc,
#  183|                          preadlinkat, stack_buf);
#  184|   }

Error: CPPCHECK_WARNING (CWE-562): [#def10]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/gettext.h:247: error[returnDanglingLifetime]: Returning pointer to local variable 'msg_ctxt_id' that will be invalid when returning.
#  245|   #endif
#  246|         if (found_translation)
#  247|->         return translation;
#  248|       }
#  249|     return msgid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/ialloc.h:51:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s + 1)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'ximalloc'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'ximalloc'
#   49|   imalloc (idx_t s)
#   50|   {
#   51|->   return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem ();
#   52|   }
#   53|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/ialloc.h:51:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'ximalloc'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'ximalloc'
#   49|   imalloc (idx_t s)
#   50|   {
#   51|->   return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem ();
#   52|   }
#   53|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/ialloc.h:81:10: warning[-Wanalyzer-malloc-leak]: leak of 'xicalloc(s, 1)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xicalloc'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xicalloc'
#   79|         s = 0;
#   80|       }
#   81|->   return calloc (n, s);
#   82|   }
#   83|   

Error: CPPCHECK_WARNING: [#def14]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/printf-parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def15]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/quotearg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def16]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/vasnprintf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xmalloc'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(n)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:22: included_from: Included from here.
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:57:10: note: in expansion of macro 'XNMALLOC'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:57:10: note: in expansion of macro 'XNMALLOC'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xmalloc'
#   43|   xmalloc (size_t s)
#   44|   {
#   45|->   return nonnull (malloc (s));
#   46|   }
#   47|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:45:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(s)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xmalloc'
#   43|   xmalloc (size_t s)
#   44|   {
#   45|->   return nonnull (malloc (s));
#   46|   }
#   47|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xcalloc'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:298:10: warning[-Wanalyzer-malloc-leak]: leak of 'xcalloc(s, 1)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xcalloc'
#  296|   xcalloc (size_t n, size_t s)
#  297|   {
#  298|->   return nonnull (calloc (n, s));
#  299|   }
#  300|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xmemdup'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c:314:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmemdup(string,  strlen(string) + 1)'
libpaper-2.1.1-build/libpaper-2.1.1/src/libgnu/xmalloc.c: scope_hint: In function 'xmemdup'
#  312|   xmemdup (void const *p, size_t s)
#  313|   {
#  314|->   return memcpy (xmalloc (s), p, s);
#  315|   }
#  316|   

Error: CPPCHECK_WARNING (CWE-664): [#def21]
libpaper-2.1.1-build/libpaper-2.1.1/src/paper.c:102: error[va_end_missing]: va_list 'ap' was opened but not closed by va_end().
#  100|       putc('\n', stderr);
#  101|       exit(1);
#  102|-> }
#  103|   
#  104|   static void paper_die(const char *msg)

Error: CPPCHECK_WARNING: [#def22]
libpaper-2.1.1-build/libpaper-2.1.1/src/paperconf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def23]
libpaper-2.1.1-build/libpaper-2.1.1/src/paperconf.c:91:2: warning[deadcode.DeadStores]: Value stored to 'pr' is never read
#   89|   	else
#   90|   	    printf("%g", paperpsheight(paper) );
#   91|-> 	pr = 1;
#   92|       }
#   93|   

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-193.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibpaper-2.1.1-6.fc41
store-results-to/tmp/tmpgds_lsc8/libpaper-2.1.1-6.fc41.tar.xz
time-created2024-07-03 15:51:22
time-finished2024-07-03 15:52:26
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpgds_lsc8/libpaper-2.1.1-6.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpgds_lsc8/libpaper-2.1.1-6.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9