libreport-2.17.15-9.fc44

List of Findings

Error: CPPCHECK_WARNING (CWE-457): [#def1]
libreport-2.17.15/src/cli/cli-report.c:845: warning[uninitvar]: Uninitialized variable: help_wf_array
#  843|   
#  844|       const unsigned picked = choose_number_from_range(1, count, _("Select a workflow to run: "));
#  845|->     return help_wf_array[picked - 1];
#  846|   }
#  847|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def2]
libreport-2.17.15/src/include/problem_data.h:78:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘problem_data’
libreport-2.17.15/src/cli/cli-report.c:736:12: enter_function: entry to ‘run_event_chain_real’
libreport-2.17.15/src/cli/cli-report.c:748:32: branch_true: following ‘true’ branch (when ‘eitem’ is non-NULL)...
libreport-2.17.15/src/cli/cli-report.c:750:9: branch_true: ...to here
libreport-2.17.15/src/cli/cli-report.c:754:12: branch_true: following ‘true’ branch (when ‘interactive != 0’)...
libreport-2.17.15/src/cli/cli-report.c:755:22: branch_true: ...to here
libreport-2.17.15/src/cli/cli-report.c:755:22: call_function: calling ‘run_event_on_dir_name_interactively’ from ‘run_event_chain_real’
#   76|   }
#   77|   
#   78|-> G_DEFINE_AUTOPTR_CLEANUP_FUNC(problem_data_t, problem_data_free);
#   79|   
#   80|   void problem_data_add_basics(problem_data_t *pd);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
libreport-2.17.15/src/include/report_result.h:36:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘result’
libreport-2.17.15/src/plugins/reporter-ureport.c:27:5: enter_function: entry to ‘main’
libreport-2.17.15/src/plugins/reporter-ureport.c:145:8: branch_false: following ‘false’ branch...
libreport-2.17.15/src/plugins/reporter-ureport.c:148:9: branch_false: ...to here
libreport-2.17.15/src/plugins/reporter-ureport.c:180:12: branch_false: following ‘false’ branch...
libreport-2.17.15/src/plugins/reporter-ureport.c:183:13: branch_false: ...to here
libreport-2.17.15/src/plugins/reporter-ureport.c:204:12: branch_true: following ‘true’ branch...
libreport-2.17.15/src/plugins/reporter-ureport.c:207:30: branch_true: ...to here
libreport-2.17.15/src/plugins/reporter-ureport.c:209:22: throw: if ‘libreport_find_in_reported_to’ throws an exception...
libreport-2.17.15/src/plugins/reporter-ureport.c:207:30: call_function: calling ‘g_autoptr_cleanup_generic_gfree’ from ‘main’
libreport-2.17.15/src/plugins/reporter-ureport.c:206:40: call_function: inlined call to ‘glib_autoptr_cleanup_report_result_t’ from ‘main’
#   34|   void report_result_free(report_result_t *result);
#   35|   
#   36|-> G_DEFINE_AUTOPTR_CLEANUP_FUNC(report_result_t, report_result_free)
#   37|   
#   38|   G_END_DECLS

Error: GCC_ANALYZER_WARNING (CWE-404): [#def4]
libreport-2.17.15/src/lib/abrt_xmlrpc.c:222:5: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libreport-2.17.15/src/lib/abrt_xmlrpc.c:319:15: enter_function: entry to 'abrt_xmlrpc_call'
libreport-2.17.15/src/lib/abrt_xmlrpc.c:325:5: acquire_resource: 'va_start' called here
libreport-2.17.15/src/lib/abrt_xmlrpc.c:326:28: call_function: calling 'abrt_xmlrpc_call_full_va' from 'abrt_xmlrpc_call'
#  220|                                          va_list args)
#  221|   {
#  222|->     xmlrpc_env_init(env);
#  223|   
#  224|       xmlrpc_value* param = NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def5]
libreport-2.17.15/src/lib/abrt_xmlrpc.c:227:5: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libreport-2.17.15/src/lib/abrt_xmlrpc.c:319:15: enter_function: entry to 'abrt_xmlrpc_call'
libreport-2.17.15/src/lib/abrt_xmlrpc.c:325:5: acquire_resource: 'va_start' called here
libreport-2.17.15/src/lib/abrt_xmlrpc.c:326:28: call_function: calling 'abrt_xmlrpc_call_full_va' from 'abrt_xmlrpc_call'
#  225|       const char* suffix;
#  226|   
#  227|->     xmlrpc_build_value_va(env, format, args, &param, &suffix);
#  228|       if (env->fault_occurred)
#  229|           abrt_xmlrpc_die(env);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
libreport-2.17.15/src/lib/compress.c:33:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:104:5: enter_function: entry to 'libreport_decompress_file_ext_at'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:115:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:122:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:122:15: call_function: calling 'libreport_decompress_fd' from 'libreport_decompress_file_ext_at'
#   31|   
#   32|       retval = 0;
#   33|->     archive = archive_read_new();
#   34|   
#   35|       archive_read_support_filter_all(archive);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
libreport-2.17.15/src/lib/compress.c:35:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:104:5: enter_function: entry to 'libreport_decompress_file_ext_at'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:115:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:122:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:122:15: call_function: calling 'libreport_decompress_fd' from 'libreport_decompress_file_ext_at'
#   33|       archive = archive_read_new();
#   34|   
#   35|->     archive_read_support_filter_all(archive);
#   36|       archive_read_support_format_raw(archive);
#   37|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libreport-2.17.15/src/lib/compress.c:36:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:104:5: enter_function: entry to 'libreport_decompress_file_ext_at'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:115:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:122:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:122:15: call_function: calling 'libreport_decompress_fd' from 'libreport_decompress_file_ext_at'
#   34|   
#   35|       archive_read_support_filter_all(archive);
#   36|->     archive_read_support_format_raw(archive);
#   37|   
#   38|       r = archive_read_open_fd(archive, fdi, BUFFER_SIZE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libreport-2.17.15/src/lib/compress.c:38:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:104:5: enter_function: entry to 'libreport_decompress_file_ext_at'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:115:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:122:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:122:15: call_function: calling 'libreport_decompress_fd' from 'libreport_decompress_file_ext_at'
#   36|       archive_read_support_format_raw(archive);
#   37|   
#   38|->     r = archive_read_open_fd(archive, fdi, BUFFER_SIZE);
#   39|       if (r != ARCHIVE_OK)
#   40|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
libreport-2.17.15/src/lib/compress.c:114:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:114:15: throw: if 'openat' throws an exception...
libreport-2.17.15/src/lib/compress.c:114:15: danger: 'open(path_in,  src_flags)' leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  112|       }
#  113|   
#  114|->     int fdo = openat(dir_fd, path_out, dst_flags, mode_out);
#  115|       if (fdo < 0)
#  116|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
libreport-2.17.15/src/lib/compress.c:117:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(path_in,  src_flags)'
libreport-2.17.15/src/lib/compress.c:107:15: acquire_resource: opened here
libreport-2.17.15/src/lib/compress.c:108:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/compress.c:114:15: branch_false: ...to here
libreport-2.17.15/src/lib/compress.c:115:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/compress.c:117:9: branch_true: ...to here
libreport-2.17.15/src/lib/compress.c:117:9: danger: 'open(path_in,  src_flags)' leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  115|       if (fdo < 0)
#  116|       {
#  117|->         close(fdi);
#  118|           perror_msg("Could not create file: %s", path_out);
#  119|           return -1;

Error: COMPILER_WARNING (CWE-704): [#def12]
libreport-2.17.15/src/lib/concat_path_file.c: scope_hint: In function 'libreport_concat_path_basename'
libreport-2.17.15/src/lib/concat_path_file.c:25:18: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#   25 |     char *base = strrchr((abspath ? abspath : filename), '/');
#      |                  ^~~~~~~
#   23|   {
#   24|       g_autofree char *abspath = realpath(filename, NULL);
#   25|->     char *base = strrchr((abspath ? abspath : filename), '/');
#   26|   
#   27|       /* If realpath failed and filename is malicious (say, "/foo/.."),

Error: COMPILER_WARNING (CWE-704): [#def13]
libreport-2.17.15/src/lib/concat_path_file.c:25:18: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#   23|   {
#   24|       g_autofree char *abspath = realpath(filename, NULL);
#   25|->     char *base = strrchr((abspath ? abspath : filename), '/');
#   26|   
#   27|       /* If realpath failed and filename is malicious (say, "/foo/.."),

Error: GCC_ANALYZER_WARNING (CWE-775): [#def14]
libreport-2.17.15/src/lib/copyfd.c:67:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(src_name,  src_flags)'
libreport-2.17.15/src/lib/copyfd.c:198:7: enter_function: entry to 'libreport_copy_file_ext_at'
libreport-2.17.15/src/lib/copyfd.c:201:15: acquire_resource: opened here
libreport-2.17.15/src/lib/copyfd.c:202:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/copyfd.c:208:9: branch_false: ...to here
libreport-2.17.15/src/lib/copyfd.c:208:9: call_function: calling 'libreport_copyfd_ext_at' from 'libreport_copy_file_ext_at'
#   65|   		ssize_t rd, towrite;
#   66|   
#   67|-> 		rd = libreport_safe_read(src_fd, buffer, buffer_size);
#   68|   
#   69|   		if (!rd) { /* eof - all done */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def15]
libreport-2.17.15/src/lib/copyfd.c:133:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(src_name,  src_flags)'
libreport-2.17.15/src/lib/copyfd.c:198:7: enter_function: entry to 'libreport_copy_file_ext_at'
libreport-2.17.15/src/lib/copyfd.c:201:15: acquire_resource: opened here
libreport-2.17.15/src/lib/copyfd.c:202:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/copyfd.c:208:9: branch_false: ...to here
libreport-2.17.15/src/lib/copyfd.c:208:9: call_function: calling 'libreport_copyfd_ext_at' from 'libreport_copy_file_ext_at'
#  131|   off_t libreport_copyfd_ext_at(int src, int dir_fd, const char *name, int mode, uid_t uid, gid_t gid, int open_flags, int copy_flags, off_t size)
#  132|   {
#  133|->     int dst = openat(dir_fd, name, open_flags, mode);
#  134|       if (dst < 0)
#  135|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
libreport-2.17.15/src/lib/copyfd.c:136:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(src_name,  src_flags)'
libreport-2.17.15/src/lib/copyfd.c:198:7: enter_function: entry to 'libreport_copy_file_ext_at'
libreport-2.17.15/src/lib/copyfd.c:201:15: acquire_resource: opened here
libreport-2.17.15/src/lib/copyfd.c:202:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/copyfd.c:208:9: branch_false: ...to here
libreport-2.17.15/src/lib/copyfd.c:208:9: call_function: calling 'libreport_copyfd_ext_at' from 'libreport_copy_file_ext_at'
#  134|       if (dst < 0)
#  135|       {
#  136|->         perror_msg("Can't open '%s'", name);
#  137|           return -1;
#  138|       }

Error: COMPILER_WARNING (CWE-477): [#def17]
libreport-2.17.15/src/lib/curl.c: scope_hint: In function 'post'
libreport-2.17.15/src/lib/curl.c:426:9: warning[-Wdeprecated-declarations]: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init()
#  426 |         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#      |         ^~~~~~~~~~~~
libreport-2.17.15/src/include/libreport_curl.h:22: included_from: Included from here.
libreport-2.17.15/src/lib/curl.c:21: included_from: Included from here.
/usr/include/curl/curl.h:2628:1: note: declared here
# 2628 | curl_formadd(struct curl_httppost **httppost,
#      | ^~~~~~~~~~~~
#  424|           fseeko(data_file, 0, SEEK_SET);
#  425|           // Create formdata
#  426|->         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  427|                           CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:

Error: COMPILER_WARNING (CWE-477): [#def18]
libreport-2.17.15/src/lib/curl.c:426:9: warning[-Wdeprecated-declarations]: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init()
#  424|           fseeko(data_file, 0, SEEK_SET);
#  425|           // Create formdata
#  426|->         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  427|                           CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:

Error: COMPILER_WARNING (CWE-477): [#def19]
libreport-2.17.15/src/lib/curl.c:427:25: warning[-Wdeprecated-declarations]: 'CURLFORM_PTRNAME' is deprecated: since 7.56.0. Use curl_mime_name()
#  427 |                         CURLFORM_PTRNAME, "file", // element name
#      |                         ^~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2554:3: note: declared here
# 2554 |   CURLFORM_PTRNAME         CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
#      |   ^~~~~~~~~~~~~~~~
#  425|           // Create formdata
#  426|           CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  427|->                         CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|                           CURLFORM_STREAM, data_file,

Error: COMPILER_WARNING (CWE-477): [#def20]
libreport-2.17.15/src/lib/curl.c:427:25: warning[-Wdeprecated-declarations]: 'CURLFORM_PTRNAME' is deprecated: since 7.56.0. Use curl_mime_name()
#  425|           // Create formdata
#  426|           CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  427|->                         CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|                           CURLFORM_STREAM, data_file,

Error: COMPILER_WARNING (CWE-477): [#def21]
libreport-2.17.15/src/lib/curl.c:429:25: warning[-Wdeprecated-declarations]: 'CURLFORM_STREAM' is deprecated: since 7.56.0. Use curl_mime_data_cb()
#  429 |                         CURLFORM_STREAM, data_file,
#      |                         ^~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2574:3: note: declared here
# 2574 |   CURLFORM_STREAM          CURL_DEPRECATED(7.56.0, "Use curl_mime_data_cb()"),
#      |   ^~~~~~~~~~~~~~~
#  427|                           CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|->                         CURLFORM_STREAM, data_file,
#  430|                           CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?

Error: COMPILER_WARNING (CWE-477): [#def22]
libreport-2.17.15/src/lib/curl.c:429:25: warning[-Wdeprecated-declarations]: 'CURLFORM_STREAM' is deprecated: since 7.56.0. Use curl_mime_data_cb()
#  427|                           CURLFORM_PTRNAME, "file", // element name
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|->                         CURLFORM_STREAM, data_file,
#  430|                           CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?

Error: COMPILER_WARNING (CWE-477): [#def23]
libreport-2.17.15/src/lib/curl.c:430:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTSLENGTH' is deprecated: since 7.56.0. Use curl_mime_data()
#  430 |                         CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2558:3: note: declared here
# 2558 |   CURLFORM_CONTENTSLENGTH  CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
#      |   ^~~~~~~~~~~~~~~~~~~~~~~
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|                           CURLFORM_STREAM, data_file,
#  430|->                         CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|                           CURLFORM_CONTENTTYPE, content_type,

Error: COMPILER_WARNING (CWE-477): [#def24]
libreport-2.17.15/src/lib/curl.c:430:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTSLENGTH' is deprecated: since 7.56.0. Use curl_mime_data()
#  428|                           // use CURLOPT_READFUNCTION for reading, pass data_file as its last param:
#  429|                           CURLFORM_STREAM, data_file,
#  430|->                         CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|                           CURLFORM_CONTENTTYPE, content_type,

Error: COMPILER_WARNING (CWE-477): [#def25]
libreport-2.17.15/src/lib/curl.c:432:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTTYPE' is deprecated: since 7.56.0. Use curl_mime_type()
#  432 |                         CURLFORM_CONTENTTYPE, content_type,
#      |                         ^~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2568:3: note: declared here
# 2568 |   CURLFORM_CONTENTTYPE     CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
#      |   ^~~~~~~~~~~~~~~~~~~~
#  430|                           CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|->                         CURLFORM_CONTENTTYPE, content_type,
#  433|                           CURLFORM_FILENAME, basename, // filename to put in the form
#  434|                           CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def26]
libreport-2.17.15/src/lib/curl.c:432:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTTYPE' is deprecated: since 7.56.0. Use curl_mime_type()
#  430|                           CURLFORM_CONTENTSLENGTH, (long)sz, // a must if we use CURLFORM_STREAM option
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|->                         CURLFORM_CONTENTTYPE, content_type,
#  433|                           CURLFORM_FILENAME, basename, // filename to put in the form
#  434|                           CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def27]
libreport-2.17.15/src/lib/curl.c:433:25: warning[-Wdeprecated-declarations]: 'CURLFORM_FILENAME' is deprecated: since 7.56.0. Use curl_mime_filename()
#  433 |                         CURLFORM_FILENAME, basename, // filename to put in the form
#      |                         ^~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2570:3: note: declared here
# 2570 |   CURLFORM_FILENAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
#      |   ^~~~~~~~~~~~~~~~~
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|                           CURLFORM_CONTENTTYPE, content_type,
#  433|->                         CURLFORM_FILENAME, basename, // filename to put in the form
#  434|                           CURLFORM_END);
#  435|   

Error: COMPILER_WARNING (CWE-477): [#def28]
libreport-2.17.15/src/lib/curl.c:433:25: warning[-Wdeprecated-declarations]: 'CURLFORM_FILENAME' is deprecated: since 7.56.0. Use curl_mime_filename()
#  431|   //FIXME: what if file size doesn't fit in long?
#  432|                           CURLFORM_CONTENTTYPE, content_type,
#  433|->                         CURLFORM_FILENAME, basename, // filename to put in the form
#  434|                           CURLFORM_END);
#  435|   

Error: COMPILER_WARNING (CWE-477): [#def29]
libreport-2.17.15/src/lib/curl.c:439:9: warning[-Wdeprecated-declarations]: 'CURLOPT_HTTPPOST' is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#  439 |         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#      |         ^~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:1231:3: note: declared here
# 1231 |   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
#      |   ^~~~~~~~~~~~~~~~~
#  437|   //FIXME:
#  438|               error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err);
#  439|->         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#  440|       }
#  441|       else if (data_size == POST_DATA_STRING_AS_FORM_DATA)

Error: COMPILER_WARNING (CWE-477): [#def30]
libreport-2.17.15/src/lib/curl.c:439:9: warning[-Wdeprecated-declarations]: 'CURLOPT_HTTPPOST' is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#  437|   //FIXME:
#  438|               error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err);
#  439|->         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#  440|       }
#  441|       else if (data_size == POST_DATA_STRING_AS_FORM_DATA)

Error: COMPILER_WARNING (CWE-477): [#def31]
libreport-2.17.15/src/lib/curl.c:443:9: warning[-Wdeprecated-declarations]: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init()
#  443 |         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#      |         ^~~~~~~~~~~~
/usr/include/curl/curl.h:2628:1: note: declared here
# 2628 | curl_formadd(struct curl_httppost **httppost,
#      | ^~~~~~~~~~~~
#  441|       else if (data_size == POST_DATA_STRING_AS_FORM_DATA)
#  442|       {
#  443|->         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  444|                           CURLFORM_PTRNAME, "file", // element name
#  445|                           // curl bug - missing filename

Error: COMPILER_WARNING (CWE-477): [#def32]
libreport-2.17.15/src/lib/curl.c:443:9: warning[-Wdeprecated-declarations]: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init()
#  441|       else if (data_size == POST_DATA_STRING_AS_FORM_DATA)
#  442|       {
#  443|->         CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  444|                           CURLFORM_PTRNAME, "file", // element name
#  445|                           // curl bug - missing filename

Error: COMPILER_WARNING (CWE-477): [#def33]
libreport-2.17.15/src/lib/curl.c:444:25: warning[-Wdeprecated-declarations]: 'CURLFORM_PTRNAME' is deprecated: since 7.56.0. Use curl_mime_name()
#  444 |                         CURLFORM_PTRNAME, "file", // element name
#      |                         ^~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2554:3: note: declared here
# 2554 |   CURLFORM_PTRNAME         CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
#      |   ^~~~~~~~~~~~~~~~
#  442|       {
#  443|           CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  444|->                         CURLFORM_PTRNAME, "file", // element name
#  445|                           // curl bug - missing filename
#  446|                           // http://curl.haxx.se/mail/lib-2011-07/0176.html

Error: COMPILER_WARNING (CWE-477): [#def34]
libreport-2.17.15/src/lib/curl.c:444:25: warning[-Wdeprecated-declarations]: 'CURLFORM_PTRNAME' is deprecated: since 7.56.0. Use curl_mime_name()
#  442|       {
#  443|           CURLFORMcode curlform_err = curl_formadd(&post, &last,
#  444|->                         CURLFORM_PTRNAME, "file", // element name
#  445|                           // curl bug - missing filename
#  446|                           // http://curl.haxx.se/mail/lib-2011-07/0176.html

Error: COMPILER_WARNING (CWE-477): [#def35]
libreport-2.17.15/src/lib/curl.c:451:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFER' is deprecated: since 7.56.0. Use curl_mime_filename()
#  451 |                         CURLFORM_BUFFER, "*buffer*", // provides filename
#      |                         ^~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2564:3: note: declared here
# 2564 |   CURLFORM_BUFFER          CURL_DEPRECATED(7.56.0, "Use curl_mime_filename()"),
#      |   ^~~~~~~~~~~~~~~
#  449|                           // tested with curl-7.24.0-3
#  450|                           // should be working on F17
#  451|->                         CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|                           CURLFORM_BUFFERPTR, data,
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),

Error: COMPILER_WARNING (CWE-477): [#def36]
libreport-2.17.15/src/lib/curl.c:451:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFER' is deprecated: since 7.56.0. Use curl_mime_filename()
#  449|                           // tested with curl-7.24.0-3
#  450|                           // should be working on F17
#  451|->                         CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|                           CURLFORM_BUFFERPTR, data,
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),

Error: COMPILER_WARNING (CWE-477): [#def37]
libreport-2.17.15/src/lib/curl.c:452:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFERPTR' is deprecated: since 7.56.0. Use curl_mime_data()
#  452 |                         CURLFORM_BUFFERPTR, data,
#      |                         ^~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2565:3: note: declared here
# 2565 |   CURLFORM_BUFFERPTR       CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
#      |   ^~~~~~~~~~~~~~~~~~
#  450|                           // should be working on F17
#  451|                           CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|->                         CURLFORM_BUFFERPTR, data,
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?

Error: COMPILER_WARNING (CWE-477): [#def38]
libreport-2.17.15/src/lib/curl.c:452:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFERPTR' is deprecated: since 7.56.0. Use curl_mime_data()
#  450|                           // should be working on F17
#  451|                           CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|->                         CURLFORM_BUFFERPTR, data,
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?

Error: COMPILER_WARNING (CWE-477): [#def39]
libreport-2.17.15/src/lib/curl.c:453:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFERLENGTH' is deprecated: since 7.56.0. Use curl_mime_data()
#  453 |                         CURLFORM_BUFFERLENGTH, (long)strlen(data),
#      |                         ^~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2566:3: note: declared here
# 2566 |   CURLFORM_BUFFERLENGTH    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
#      |   ^~~~~~~~~~~~~~~~~~~~~
#  451|                           CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|                           CURLFORM_BUFFERPTR, data,
#  453|->                         CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?
#  455|                           CURLFORM_CONTENTTYPE, content_type,

Error: COMPILER_WARNING (CWE-477): [#def40]
libreport-2.17.15/src/lib/curl.c:453:25: warning[-Wdeprecated-declarations]: 'CURLFORM_BUFFERLENGTH' is deprecated: since 7.56.0. Use curl_mime_data()
#  451|                           CURLFORM_BUFFER, "*buffer*", // provides filename
#  452|                           CURLFORM_BUFFERPTR, data,
#  453|->                         CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?
#  455|                           CURLFORM_CONTENTTYPE, content_type,

Error: COMPILER_WARNING (CWE-477): [#def41]
libreport-2.17.15/src/lib/curl.c:455:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTTYPE' is deprecated: since 7.56.0. Use curl_mime_type()
#  455 |                         CURLFORM_CONTENTTYPE, content_type,
#      |                         ^~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2568:3: note: declared here
# 2568 |   CURLFORM_CONTENTTYPE     CURL_DEPRECATED(7.56.0, "Use curl_mime_type()"),
#      |   ^~~~~~~~~~~~~~~~~~~~
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?
#  455|->                         CURLFORM_CONTENTTYPE, content_type,
#  456|                           CURLFORM_END);
#  457|           if (curlform_err != 0)

Error: COMPILER_WARNING (CWE-477): [#def42]
libreport-2.17.15/src/lib/curl.c:455:25: warning[-Wdeprecated-declarations]: 'CURLFORM_CONTENTTYPE' is deprecated: since 7.56.0. Use curl_mime_type()
#  453|                           CURLFORM_BUFFERLENGTH, (long)strlen(data),
#  454|   //FIXME: what if file size doesn't fit in long?
#  455|->                         CURLFORM_CONTENTTYPE, content_type,
#  456|                           CURLFORM_END);
#  457|           if (curlform_err != 0)

Error: COMPILER_WARNING (CWE-477): [#def43]
libreport-2.17.15/src/lib/curl.c:459:9: warning[-Wdeprecated-declarations]: 'CURLOPT_HTTPPOST' is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#  459 |         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#      |         ^~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:1231:3: note: declared here
# 1231 |   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
#      |   ^~~~~~~~~~~~~~~~~
#  457|           if (curlform_err != 0)
#  458|               error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err);
#  459|->         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#  460|       }
#  461|       else if (data_size != POST_DATA_GET)

Error: COMPILER_WARNING (CWE-477): [#def44]
libreport-2.17.15/src/lib/curl.c:459:9: warning[-Wdeprecated-declarations]: 'CURLOPT_HTTPPOST' is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#  457|           if (curlform_err != 0)
#  458|               error_msg_and_die("out of memory or read error (curl_formadd error code: %d)", (int)curlform_err);
#  459|->         xcurl_easy_setopt_ptr(handle, CURLOPT_HTTPPOST, post);
#  460|       }
#  461|       else if (data_size != POST_DATA_GET)

Error: COMPILER_WARNING (CWE-477): [#def45]
libreport-2.17.15/src/lib/curl.c:565:9: warning[-Wdeprecated-declarations]: 'curl_formfree' is deprecated: since 7.56.0. Use curl_mime_free()
#  565 |         curl_formfree(post);
#      |         ^~~~~~~~~~~~~
/usr/include/curl/curl.h:2664:1: note: declared here
# 2664 | curl_formfree(struct curl_httppost *form);
#      | ^~~~~~~~~~~~~
#  563|           fclose(data_file);
#  564|       if (post)
#  565|->         curl_formfree(post);
#  566|   
#  567|       return response_code;

Error: COMPILER_WARNING (CWE-477): [#def46]
libreport-2.17.15/src/lib/curl.c:565:9: warning[-Wdeprecated-declarations]: 'curl_formfree' is deprecated: since 7.56.0. Use curl_mime_free()
#  563|           fclose(data_file);
#  564|       if (post)
#  565|->         curl_formfree(post);
#  566|   
#  567|       return response_code;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
libreport-2.17.15/src/lib/dirsize.c:34:18: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(pPath)'
libreport-2.17.15/src/lib/dirsize.c:74:8: enter_function: entry to 'libreport_get_dirsize_find_largest_dir'
libreport-2.17.15/src/lib/dirsize.c:84:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dirsize.c:87:23: branch_false: ...to here
libreport-2.17.15/src/lib/dirsize.c:92:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/dirsize.c:94:37: branch_true: ...to here
libreport-2.17.15/src/lib/dirsize.c:99:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/dirsize.c:101:13: branch_true: ...to here
libreport-2.17.15/src/lib/dirsize.c:102:21: call_function: calling 'libreport_get_dirsize' from 'libreport_get_dirsize_find_largest_dir'
#   32|       struct stat statbuf;
#   33|       double size = 0;
#   34|->     while ((ep = readdir(dp)) != NULL)
#   35|       {
#   36|           if (libreport_dot_or_dotdot(ep->d_name))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
libreport-2.17.15/src/lib/dirsize.c:92:18: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(pPath)'
libreport-2.17.15/src/lib/dirsize.c:83:15: acquire_memory: allocated here
libreport-2.17.15/src/lib/dirsize.c:84:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dirsize.c:87:23: branch_false: ...to here
libreport-2.17.15/src/lib/dirsize.c:92:18: throw: if 'readdir' throws an exception...
libreport-2.17.15/src/lib/dirsize.c:92:18: danger: 'opendir(pPath)' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   90|       double size = 0;
#   91|       double maxsz = 0;
#   92|->     while ((ep = readdir(dp)) != NULL)
#   93|       {
#   94|           if (libreport_dot_or_dotdot(ep->d_name))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
libreport-2.17.15/src/lib/dump_dir.c:213:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&reopen_buf, 0)'
libreport-2.17.15/src/lib/dump_dir.c:1887:5: enter_function: entry to 'dd_load_uint64'
libreport-2.17.15/src/lib/dump_dir.c:1890:21: call_function: calling 'read_number_from_file_at' from 'dd_load_uint64'
#  211|   
#  212|       const int fd = open(reopen_buf, O_RDONLY);
#  213|->     close(path_fd);
#  214|   
#  215|       return fd;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libreport-2.17.15/src/lib/dump_dir.c:886:5: warning[-Wanalyzer-malloc-leak]: leak of 'd'
libreport-2.17.15/src/lib/dump_dir.c:1411:6: enter_function: entry to 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1423:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1426:10: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1426:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1429:5: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1429:5: call_function: calling 'dd_init_next_file' from 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1429:5: return_function: returning to 'dd_sanitize_mode_and_owner' from 'dd_init_next_file'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: call_function: calling 'dd_get_next_file' from 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: return_function: returning to 'dd_sanitize_mode_and_owner' from 'dd_get_next_file'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1456:5: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1456:5: call_function: calling 'dd_sanitize_mode_meta_data' from 'dd_sanitize_mode_and_owner'
#  884|       }
#  885|   
#  886|->     FOREACH_REGULAR_FILE_AS_FD_AT_BEGIN(dd_md_fd)
#  887|       {
#  888|           log_debug("chmoding %s", dent->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def51]
libreport-2.17.15/src/lib/dump_dir.c:886:5: warning[-Wanalyzer-null-argument]: use of NULL 'd' where non-null expected
libreport-2.17.15/src/lib/dump_dir.c:1411:6: enter_function: entry to 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1423:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1426:10: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1426:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1429:5: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1429:5: call_function: calling 'dd_init_next_file' from 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1429:5: return_function: returning to 'dd_sanitize_mode_and_owner' from 'dd_init_next_file'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: call_function: calling 'dd_get_next_file' from 'dd_sanitize_mode_and_owner'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: return_function: returning to 'dd_sanitize_mode_and_owner' from 'dd_get_next_file'
libreport-2.17.15/src/lib/dump_dir.c:1431:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1456:5: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1456:5: call_function: calling 'dd_sanitize_mode_meta_data' from 'dd_sanitize_mode_and_owner'
#  884|       }
#  885|   
#  886|->     FOREACH_REGULAR_FILE_AS_FD_AT_BEGIN(dd_md_fd)
#  887|       {
#  888|           log_debug("chmoding %s", dent->d_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libreport-2.17.15/src/lib/dump_dir.c:922:5: warning[-Wanalyzer-malloc-leak]: leak of 'd'
libreport-2.17.15/src/lib/dump_dir.c:1291:5: enter_function: entry to 'dd_reset_ownership'
libreport-2.17.15/src/lib/dump_dir.c:1293:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1296:43: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1303:9: call_function: calling 'dd_chown_meta_data' from 'dd_reset_ownership'
#  920|       }
#  921|   
#  922|->     FOREACH_REGULAR_FILE_AS_FD_AT_BEGIN(dd_md_fd)
#  923|       {
#  924|           log_debug("%s: chowning %s", __func__, dent->d_name);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def53]
libreport-2.17.15/src/lib/dump_dir.c:922:5: warning[-Wanalyzer-null-argument]: use of NULL 'd' where non-null expected
libreport-2.17.15/src/lib/dump_dir.c:1291:5: enter_function: entry to 'dd_reset_ownership'
libreport-2.17.15/src/lib/dump_dir.c:1293:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1296:43: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1303:9: call_function: calling 'dd_chown_meta_data' from 'dd_reset_ownership'
#  920|       }
#  921|   
#  922|->     FOREACH_REGULAR_FILE_AS_FD_AT_BEGIN(dd_md_fd)
#  923|       {
#  924|           log_debug("%s: chowning %s", __func__, dent->d_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libreport-2.17.15/src/lib/dump_dir.c:1480:20: warning[-Wanalyzer-malloc-leak]: leak of 'd'
libreport-2.17.15/src/lib/dump_dir.c:1460:12: enter_function: entry to 'delete_file_dir'
libreport-2.17.15/src/lib/dump_dir.c:1463:15: call_function: calling 'fdreopen' from 'delete_file_dir'
libreport-2.17.15/src/lib/dump_dir.c:1463:15: return_function: returning to 'delete_file_dir' from 'fdreopen'
libreport-2.17.15/src/lib/dump_dir.c:1464:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1464:8: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1480:20: throw: if 'readdir' throws an exception...
libreport-2.17.15/src/lib/dump_dir.c:1480:20: danger: 'd' leaks here; was allocated at [(6)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/5)
# 1478|       bool unlink_lock_file = false;
# 1479|       struct dirent *dent;
# 1480|->     while ((dent = readdir(d)) != NULL)
# 1481|       {
# 1482|           if (libreport_dot_or_dotdot(dent->d_name))

Error: GCC_ANALYZER_WARNING (CWE-688): [#def55]
libreport-2.17.15/src/lib/dump_dir.c:1480:20: warning[-Wanalyzer-null-argument]: use of NULL 'd' where non-null expected
libreport-2.17.15/src/lib/dump_dir.c:1460:12: enter_function: entry to 'delete_file_dir'
libreport-2.17.15/src/lib/dump_dir.c:1463:15: call_function: calling 'fdreopen' from 'delete_file_dir'
libreport-2.17.15/src/lib/dump_dir.c:1463:15: return_function: returning to 'delete_file_dir' from 'fdreopen'
libreport-2.17.15/src/lib/dump_dir.c:1464:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/dump_dir.c:1464:8: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1480:20: danger: argument 1 ('d') NULL where non-null expected
# 1478|       bool unlink_lock_file = false;
# 1479|       struct dirent *dent;
# 1480|->     while ((dent = readdir(d)) != NULL)
# 1481|       {
# 1482|           if (libreport_dot_or_dotdot(dent->d_name))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libreport-2.17.15/src/lib/dump_dir.c:1706:28: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libreport-2.17.15/src/lib/dump_dir.c:1692:8: branch_false: following 'false' branch (when 'fd != -1')...
libreport-2.17.15/src/lib/dump_dir.c:1702:16: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1702:16: acquire_memory: allocated here
libreport-2.17.15/src/lib/dump_dir.c:1703:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libreport-2.17.15/src/lib/dump_dir.c:1706:28: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1706:28: throw: if 'g_string_new' throws an exception...
libreport-2.17.15/src/lib/dump_dir.c:1706:28: danger: 'fp' leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 1704|           libreport_die_out_of_memory();
# 1705|   
# 1706|->     GString *buf_content = g_string_new(NULL);
# 1707|       int oneline = 0;
# 1708|       int ch;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libreport-2.17.15/src/lib/dump_dir.c:1709:18: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libreport-2.17.15/src/lib/dump_dir.c:1692:8: branch_false: following 'false' branch (when 'fd != -1')...
libreport-2.17.15/src/lib/dump_dir.c:1702:16: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1702:16: acquire_memory: allocated here
libreport-2.17.15/src/lib/dump_dir.c:1703:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libreport-2.17.15/src/lib/dump_dir.c:1706:28: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:1709:18: throw: if 'fgetc' throws an exception...
libreport-2.17.15/src/lib/dump_dir.c:1709:18: danger: 'fp' leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 1707|       int oneline = 0;
# 1708|       int ch;
# 1709|->     while ((ch = fgetc(fp)) != EOF)
# 1710|       {
# 1711|   //TODO? \r -> \n?

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
libreport-2.17.15/src/lib/dump_dir.c:2125:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'opendir_fd'
libreport-2.17.15/src/lib/dump_dir.c:2096:6: enter_function: entry to 'dd_init_next_file'
libreport-2.17.15/src/lib/dump_dir.c:2100:22: acquire_resource: opened here
libreport-2.17.15/src/lib/dump_dir.c:2101:8: branch_false: following 'false' branch (when 'opendir_fd >= 0')...
libreport-2.17.15/src/lib/dump_dir.c:2107:5: branch_false: ...to here
libreport-2.17.15/src/lib/dump_dir.c:2107:5: call_function: calling 'dd_clear_next_file' from 'dd_init_next_file'
# 2123|           return;
# 2124|   
# 2125|->     closedir(dd->next_dir);
# 2126|       dd->next_dir = NULL;
# 2127|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def59]
libreport-2.17.15/src/lib/event_xml_parser.c:521:42: warning[-Wanalyzer-null-argument]: use of NULL 'parse_data.cur_locale' where non-null expected
libreport-2.17.15/src/lib/event_xml_parser.c:510:6: enter_function: entry to 'load_event_description_from_file'
libreport-2.17.15/src/lib/event_xml_parser.c:513:26: release_memory: 'parse_data.cur_locale' is NULL
libreport-2.17.15/src/lib/event_xml_parser.c:513:26: release_memory: 'parse_data.cur_locale' is NULL
libreport-2.17.15/src/lib/event_xml_parser.c:521:42: danger: argument 1 ('<unknown>') NULL where non-null expected
#  519|       };
#  520|       parse_data.cur_locale = g_strdup(setlocale(LC_ALL, NULL));
#  521|->     strchrnul(parse_data.cur_locale, '.')[0] = '\0';
#  522|   
#  523|       GMarkupParser parser;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
libreport-2.17.15/src/lib/event_xml_parser.c:510:6: enter_function: entry to 'load_event_description_from_file'
libreport-2.17.15/src/lib/event_xml_parser.c:535:17: acquire_resource: opened here
libreport-2.17.15/src/lib/event_xml_parser.c:536:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/event_xml_parser.c:536:8: branch_true: ...to here
libreport-2.17.15/src/lib/event_xml_parser.c:540:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: branch_true: ...to here
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: throw: if 'g_markup_parse_context_parse' throws an exception...
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: danger: 'fopen(filename, "r")' leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  540|           while ((read_bytes = fread(buff, 1, 1024, fin)) != 0)
#  541|           {
#  542|->             g_markup_parse_context_parse(context, buff, read_bytes, NULL);
#  543|           }
#  544|           fclose(fin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
libreport-2.17.15/src/lib/event_xml_parser.c:510:6: enter_function: entry to 'load_event_description_from_file'
libreport-2.17.15/src/lib/event_xml_parser.c:535:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/event_xml_parser.c:536:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/event_xml_parser.c:536:8: branch_true: ...to here
libreport-2.17.15/src/lib/event_xml_parser.c:540:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: branch_true: ...to here
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: throw: if 'g_markup_parse_context_parse' throws an exception...
libreport-2.17.15/src/lib/event_xml_parser.c:542:13: danger: 'fopen(filename, "r")' leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  540|           while ((read_bytes = fread(buff, 1, 1024, fin)) != 0)
#  541|           {
#  542|->             g_markup_parse_context_parse(context, buff, read_bytes, NULL);
#  543|           }
#  544|           fclose(fin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libreport-2.17.15/src/lib/file_list.c:32:20: warning[-Wanalyzer-malloc-leak]: leak of 'opendir(path)'
libreport-2.17.15/src/lib/file_list.c:26:11: acquire_memory: allocated here
libreport-2.17.15/src/lib/file_list.c:27:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/file_list.c:27:8: branch_false: ...to here
libreport-2.17.15/src/lib/file_list.c:32:20: throw: if 'readdir' throws an exception...
libreport-2.17.15/src/lib/file_list.c:32:20: danger: 'opendir(path)' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   30|       GList *files = NULL;
#   31|       struct dirent *dent;
#   32|->     while ((dent = readdir(dir)) != NULL)
#   33|       {
#   34|           /* skip . and .. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
libreport-2.17.15/src/lib/get_cmdline.c:264:22: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(openat(pid_proc_fd, "fd", 720896))'
libreport-2.17.15/src/lib/get_cmdline.c:326:5: enter_function: entry to 'libreport_dump_fd_info_ext'
libreport-2.17.15/src/lib/get_cmdline.c:335:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:341:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:342:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:348:15: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:349:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:355:12: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:356:9: call_function: calling 'libreport_dump_fd_info_at' from 'libreport_dump_fd_info_ext'
#  262|       }
#  263|   
#  264|->     proc_fdinfo_fd = openat(pid_proc_fd, "fdinfo", O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  265|       if (proc_fdinfo_fd < 0)
#  266|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
libreport-2.17.15/src/lib/get_cmdline.c:274:16: warning[-Wanalyzer-malloc-leak]: leak of 'fdopendir(openat(pid_proc_fd, "fd", 720896))'
libreport-2.17.15/src/lib/get_cmdline.c:326:5: enter_function: entry to 'libreport_dump_fd_info_ext'
libreport-2.17.15/src/lib/get_cmdline.c:335:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:341:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:342:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:348:15: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:349:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:355:12: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:356:9: call_function: calling 'libreport_dump_fd_info_at' from 'libreport_dump_fd_info_ext'
#  272|       {
#  273|           errno = 0;
#  274|->         dent = readdir(proc_fd_dir);
#  275|           if (dent == NULL)
#  276|           {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def65]
libreport-2.17.15/src/lib/get_cmdline.c:341:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(proc_pid_fd_path, 2818048)'
libreport-2.17.15/src/lib/get_cmdline.c:334:22: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:335:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:341:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:341:19: throw: if 'openat' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:341:19: danger: 'open(proc_pid_fd_path, 2818048)' leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  339|       }
#  340|   
#  341|->     pid_proc_fd = openat(proc_fd_dir_fd, "../", O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  342|       if (pid_proc_fd < 0)
#  343|       {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def66]
libreport-2.17.15/src/lib/get_cmdline.c:403:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
libreport-2.17.15/src/lib/get_cmdline.c:457:5: enter_function: entry to 'libreport_get_env_variable'
libreport-2.17.15/src/lib/get_cmdline.c:462:23: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:463:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:469:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:469:19: call_function: calling 'libreport_get_env_variable_ext' from 'libreport_get_env_variable'
#  401|       if (workfd < 0)
#  402|       {
#  403|->         perror_msg("dup()");
#  404|           return -errno;
#  405|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def67]
libreport-2.17.15/src/lib/get_cmdline.c:410:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
libreport-2.17.15/src/lib/get_cmdline.c:457:5: enter_function: entry to 'libreport_get_env_variable'
libreport-2.17.15/src/lib/get_cmdline.c:462:23: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:463:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:469:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:469:19: call_function: calling 'libreport_get_env_variable_ext' from 'libreport_get_env_variable'
#  408|       if (fenv == NULL)
#  409|       {
#  410|->         close(workfd);
#  411|           perror_msg("fdopen()");
#  412|           return -errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def68]
libreport-2.17.15/src/lib/get_cmdline.c:411:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
libreport-2.17.15/src/lib/get_cmdline.c:457:5: enter_function: entry to 'libreport_get_env_variable'
libreport-2.17.15/src/lib/get_cmdline.c:462:23: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:463:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:469:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:469:19: call_function: calling 'libreport_get_env_variable_ext' from 'libreport_get_env_variable'
#  409|       {
#  410|           close(workfd);
#  411|->         perror_msg("fdopen()");
#  412|           return -errno;
#  413|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def69]
libreport-2.17.15/src/lib/get_cmdline.c:421:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
libreport-2.17.15/src/lib/get_cmdline.c:457:5: enter_function: entry to 'libreport_get_env_variable'
libreport-2.17.15/src/lib/get_cmdline.c:462:23: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:463:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:469:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:469:19: call_function: calling 'libreport_get_env_variable_ext' from 'libreport_get_env_variable'
#  419|           long i = 0;
#  420|           /* Check variable name */
#  421|->         while ((c = fgetc(fenv)) != EOF && (i < len && c == name[i++]))
#  422|               ;
#  423|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
libreport-2.17.15/src/lib/get_cmdline.c:421:21: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:21: throw: if 'fgetc' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:421:21: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  419|           long i = 0;
#  420|           /* Check variable name */
#  421|->         while ((c = fgetc(fenv)) != EOF && (i < len && c == name[i++]))
#  422|               ;
#  423|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def71]
libreport-2.17.15/src/lib/get_cmdline.c:421:45: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&path, 0)'
libreport-2.17.15/src/lib/get_cmdline.c:457:5: enter_function: entry to 'libreport_get_env_variable'
libreport-2.17.15/src/lib/get_cmdline.c:462:23: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:463:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:469:19: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:469:19: call_function: calling 'libreport_get_env_variable_ext' from 'libreport_get_env_variable'
#  419|           long i = 0;
#  420|           /* Check variable name */
#  421|->         while ((c = fgetc(fenv)) != EOF && (i < len && c == name[i++]))
#  422|               ;
#  423|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libreport-2.17.15/src/lib/get_cmdline.c:431:21: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:421:45: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:431:21: throw: if 'fgetc' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:431:21: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  429|   
#  430|           /* Read to the end of variable entry */
#  431|->         while ((c = fgetc(fenv)) != EOF && c != delim)
#  432|               ++i;
#  433|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
libreport-2.17.15/src/lib/get_cmdline.c:439:18: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:421:45: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:439:18: throw: if 'g_malloc' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:439:18: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  437|   
#  438|           const int eof = c != EOF;
#  439|->         *value = g_malloc(i+1);
#  440|   
#  441|           /* i+1 because we didn't count '\0'  */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libreport-2.17.15/src/lib/get_cmdline.c:442:13: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:421:45: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:442:13: throw: if 'fseek' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:442:13: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  440|   
#  441|           /* i+1 because we didn't count '\0'  */
#  442|->         if (fseek(fenv, -(i+eof), SEEK_CUR) < 0)
#  443|               error_msg_and_die("Failed to seek");
#  444|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
libreport-2.17.15/src/lib/get_cmdline.c:443:13: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:421:45: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:442:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:443:13: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:443:13: throw: if 'log_and_die_wrapper' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:443:13: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  441|           /* i+1 because we didn't count '\0'  */
#  442|           if (fseek(fenv, -(i+eof), SEEK_CUR) < 0)
#  443|->             error_msg_and_die("Failed to seek");
#  444|   
#  445|           if (fread(*value, 1, i, fenv) != i)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
libreport-2.17.15/src/lib/get_cmdline.c:446:13: warning[-Wanalyzer-malloc-leak]: leak of 'fenv'
libreport-2.17.15/src/lib/get_cmdline.c:401:8: branch_false: following 'false' branch (when 'workfd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:407:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:407:18: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:408:8: branch_false: following 'false' branch (when 'fenv' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:415:18: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: following 'true' branch (when 'c != -1')...
libreport-2.17.15/src/lib/get_cmdline.c:417:12: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:421:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:421:45: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:442:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:445:13: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:445:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/get_cmdline.c:446:13: branch_true: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:446:13: throw: if 'log_and_die_wrapper' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:446:13: danger: 'fenv' leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  444|   
#  445|           if (fread(*value, 1, i, fenv) != i)
#  446|->             error_msg_and_die("Failed to read value");
#  447|   
#  448|           (*value)[i] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def77]
libreport-2.17.15/src/lib/get_cmdline.c:492:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'cpid_proc_fd'
libreport-2.17.15/src/lib/get_cmdline.c:830:5: enter_function: entry to 'libreport_get_pid_of_container_at'
libreport-2.17.15/src/lib/get_cmdline.c:834:24: acquire_resource: opened here
libreport-2.17.15/src/lib/get_cmdline.c:835:8: branch_false: following 'false' branch (when 'cpid_proc_fd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:842:9: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:842:9: call_function: calling 'libreport_get_ns_ids_at' from 'libreport_get_pid_of_container_at'
#  490|   int libreport_get_ns_ids_at(int pid_proc_fd, struct ns_ids *ids)
#  491|   {
#  492|->     const int nsfd = openat(pid_proc_fd, "ns", O_DIRECTORY | O_PATH);
#  493|       if (nsfd < 0)
#  494|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libreport-2.17.15/src/lib/get_cmdline.c:618:17: warning[-Wanalyzer-malloc-leak]: leak of 'fin'
libreport-2.17.15/src/lib/get_cmdline.c:907:5: enter_function: entry to 'libreport_process_has_own_root_at'
libreport-2.17.15/src/lib/get_cmdline.c:913:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:920:17: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:920:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:921:8: branch_false: following 'false' branch (when 'fin' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:932:9: call_function: calling 'libreport_get_mountinfo_for_mount_point' from 'libreport_process_has_own_root_at'
#  616|       int c;
#  617|       int pre_c = 0;
#  618|->     while ((c = fgetc(fin)) != EOF && (pre_c == '\\' || c != ' ') && c != '\n')
#  619|           pre_c = c;
#  620|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libreport-2.17.15/src/lib/get_cmdline.c:658:19: warning[-Wanalyzer-malloc-leak]: leak of 'fin'
libreport-2.17.15/src/lib/get_cmdline.c:907:5: enter_function: entry to 'libreport_process_has_own_root_at'
libreport-2.17.15/src/lib/get_cmdline.c:913:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:920:17: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:920:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:921:8: branch_false: following 'false' branch (when 'fin' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:932:9: call_function: calling 'libreport_get_mountinfo_for_mount_point' from 'libreport_process_has_own_root_at'
#  656|       while (1)
#  657|       {
#  658|->         pos_bck = ftell(fin);
#  659|           if (pos_bck < 0)
#  660|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libreport-2.17.15/src/lib/get_cmdline.c:661:13: warning[-Wanalyzer-malloc-leak]: leak of 'fin'
libreport-2.17.15/src/lib/get_cmdline.c:907:5: enter_function: entry to 'libreport_process_has_own_root_at'
libreport-2.17.15/src/lib/get_cmdline.c:913:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:920:17: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:920:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:921:8: branch_false: following 'false' branch (when 'fin' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:932:9: call_function: calling 'libreport_get_mountinfo_for_mount_point' from 'libreport_process_has_own_root_at'
#  659|           if (pos_bck < 0)
#  660|           {
#  661|->             pwarn_msg("ftell");
#  662|               r = -1;
#  663|               goto get_mount_info_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
libreport-2.17.15/src/lib/get_cmdline.c:675:13: warning[-Wanalyzer-malloc-leak]: leak of 'fin'
libreport-2.17.15/src/lib/get_cmdline.c:907:5: enter_function: entry to 'libreport_process_has_own_root_at'
libreport-2.17.15/src/lib/get_cmdline.c:913:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:920:17: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:920:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:921:8: branch_false: following 'false' branch (when 'fin' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:932:9: call_function: calling 'libreport_get_mountinfo_for_mount_point' from 'libreport_process_has_own_root_at'
#  673|           if (c == EOF)
#  674|           {
#  675|->             log_notice("Mountinfo line does not have enough fields %d", fn);
#  676|               r = 1;
#  677|               goto get_mount_info_cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def82]
libreport-2.17.15/src/lib/get_cmdline.c:899:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'libreport_open_proc_pid_dir(pid)'
libreport-2.17.15/src/lib/get_cmdline.c:475:5: enter_function: entry to 'libreport_get_ns_ids'
libreport-2.17.15/src/lib/get_cmdline.c:477:23: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_get_ns_ids'
libreport-2.17.15/src/lib/get_cmdline.c:477:23: return_function: returning to 'libreport_get_ns_ids' from 'libreport_open_proc_pid_dir'
libreport-2.17.15/src/lib/get_cmdline.c:478:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:484:13: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:484:13: call_function: calling 'libreport_get_ns_ids_at' from 'libreport_get_ns_ids'
#  897|   {
#  898|       static char proc_dir_path[sizeof("/proc/%lu") + sizeof(long)*3];
#  899|->     sprintf(proc_dir_path, "/proc/%lu", (long)pid);
#  900|       return open(proc_dir_path, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  901|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def83]
libreport-2.17.15/src/lib/get_cmdline.c:899:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'libreport_open_proc_pid_dir(ppid)'
libreport-2.17.15/src/lib/get_cmdline.c:830:5: enter_function: entry to 'libreport_get_pid_of_container_at'
libreport-2.17.15/src/lib/get_cmdline.c:835:8: branch_false: following 'false' branch (when 'cpid_proc_fd >= 0')...
libreport-2.17.15/src/lib/get_cmdline.c:842:9: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:842:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:842:8: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:851:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:857:13: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:857:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:860:34: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:860:34: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_get_pid_of_container_at'
libreport-2.17.15/src/lib/get_cmdline.c:860:34: return_function: returning to 'libreport_get_pid_of_container_at' from 'libreport_open_proc_pid_dir'
libreport-2.17.15/src/lib/get_cmdline.c:861:12: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:869:13: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:869:13: call_function: calling 'libreport_get_ns_ids_at' from 'libreport_get_pid_of_container_at'
#  897|   {
#  898|       static char proc_dir_path[sizeof("/proc/%lu") + sizeof(long)*3];
#  899|->     sprintf(proc_dir_path, "/proc/%lu", (long)pid);
#  900|       return open(proc_dir_path, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  901|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def84]
libreport-2.17.15/src/lib/get_cmdline.c:899:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'libreport_open_proc_pid_dir(tested_pid)'
libreport-2.17.15/src/lib/get_cmdline.c:524:5: enter_function: entry to 'libreport_dump_namespace_diff_ext'
libreport-2.17.15/src/lib/get_cmdline.c:527:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:533:24: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:535:28: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_dump_namespace_diff_ext'
libreport-2.17.15/src/lib/get_cmdline.c:535:28: return_function: returning to 'libreport_dump_namespace_diff_ext' from 'libreport_open_proc_pid_dir'
libreport-2.17.15/src/lib/get_cmdline.c:536:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:543:30: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:543:30: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_dump_namespace_diff_ext'
libreport-2.17.15/src/lib/get_cmdline.c:543:30: return_function: returning to 'libreport_dump_namespace_diff_ext' from 'libreport_open_proc_pid_dir'
libreport-2.17.15/src/lib/get_cmdline.c:544:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:552:13: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:552:13: call_function: calling 'libreport_dump_namespace_diff_at' from 'libreport_dump_namespace_diff_ext'
#  897|   {
#  898|       static char proc_dir_path[sizeof("/proc/%lu") + sizeof(long)*3];
#  899|->     sprintf(proc_dir_path, "/proc/%lu", (long)pid);
#  900|       return open(proc_dir_path, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  901|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def85]
libreport-2.17.15/src/lib/get_cmdline.c:899:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(&proc_dir_path, 2818048)'
libreport-2.17.15/src/lib/get_cmdline.c:524:5: enter_function: entry to 'libreport_dump_namespace_diff_ext'
libreport-2.17.15/src/lib/get_cmdline.c:527:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:533:24: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:535:28: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_dump_namespace_diff_ext'
libreport-2.17.15/src/lib/get_cmdline.c:535:28: return_function: returning to 'libreport_dump_namespace_diff_ext' from 'libreport_open_proc_pid_dir'
libreport-2.17.15/src/lib/get_cmdline.c:536:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:543:30: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:543:30: call_function: calling 'libreport_open_proc_pid_dir' from 'libreport_dump_namespace_diff_ext'
#  897|   {
#  898|       static char proc_dir_path[sizeof("/proc/%lu") + sizeof(long)*3];
#  899|->     sprintf(proc_dir_path, "/proc/%lu", (long)pid);
#  900|       return open(proc_dir_path, O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC | O_PATH);
#  901|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
libreport-2.17.15/src/lib/get_cmdline.c:930:5: warning[-Wanalyzer-malloc-leak]: leak of 'fin'
libreport-2.17.15/src/lib/get_cmdline.c:913:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/get_cmdline.c:920:17: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:920:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/get_cmdline.c:921:8: branch_false: following 'false' branch (when 'fin' is non-NULL)...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: branch_false: ...to here
libreport-2.17.15/src/lib/get_cmdline.c:930:5: throw: if 'fseek' throws an exception...
libreport-2.17.15/src/lib/get_cmdline.c:930:5: danger: 'fin' leaks here; was allocated at [(3)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/2)
#  928|           return r;
#  929|       }
#  930|->     fseek(fin, 0, SEEK_SET);
#  931|   
#  932|       r = libreport_get_mountinfo_for_mount_point(fin, &pid_root, "/");

Error: COMPILER_WARNING (CWE-704): [#def87]
libreport-2.17.15/src/lib/make_descr.c: scope_hint: In function 'make_description_item_multiline'
libreport-2.17.15/src/lib/make_descr.c:32:17: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#   32 |     char *eol = strchr(content, '\n');
#      |                 ^~~~~~
#   30|   char *make_description_item_multiline(const char *name, const char *content)
#   31|   {
#   32|->     char *eol = strchr(content, '\n');
#   33|       if (!eol)
#   34|           return NULL;

Error: COMPILER_WARNING (CWE-704): [#def88]
libreport-2.17.15/src/lib/make_descr.c:32:17: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#   30|   char *make_description_item_multiline(const char *name, const char *content)
#   31|   {
#   32|->     char *eol = strchr(content, '\n');
#   33|       if (!eol)
#   34|           return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
libreport-2.17.15/src/lib/problem_report.c:112:23: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libreport-2.17.15/src/lib/problem_report.c:1194:1: enter_function: entry to 'problem_formatter_load_string'
libreport-2.17.15/src/lib/problem_report.c:1197:8: branch_true: following 'true' branch (when 'len != 0')...
libreport-2.17.15/src/lib/problem_report.c:1199:20: branch_true: ...to here
libreport-2.17.15/src/lib/problem_report.c:1199:20: acquire_memory: allocated here
libreport-2.17.15/src/lib/problem_report.c:1200:12: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libreport-2.17.15/src/lib/problem_report.c:1206:29: branch_false: ...to here
libreport-2.17.15/src/lib/problem_report.c:1206:29: call_function: calling 'load_stream' from 'problem_formatter_load_string'
#  110|   section_new(const char *name)
#  111|   {
#  112|->     section_t *self = g_malloc(sizeof(*self));
#  113|       self->name = g_strdup(name);
#  114|       self->items = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
libreport-2.17.15/src/lib/problem_report.c:204:16: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libreport-2.17.15/src/lib/problem_report.c:1194:1: enter_function: entry to 'problem_formatter_load_string'
libreport-2.17.15/src/lib/problem_report.c:1197:8: branch_true: following 'true' branch (when 'len != 0')...
libreport-2.17.15/src/lib/problem_report.c:1199:20: branch_true: ...to here
libreport-2.17.15/src/lib/problem_report.c:1199:20: acquire_memory: allocated here
libreport-2.17.15/src/lib/problem_report.c:1200:12: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libreport-2.17.15/src/lib/problem_report.c:1206:29: branch_false: ...to here
libreport-2.17.15/src/lib/problem_report.c:1206:29: call_function: calling 'load_stream' from 'problem_formatter_load_string'
#  202|       section_t *sec = NULL;
#  203|   
#  204|->     sections = g_list_append(sections, master);
#  205|   
#  206|       char *line;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
libreport-2.17.15/src/lib/problem_report.c:207:20: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libreport-2.17.15/src/lib/problem_report.c:1194:1: enter_function: entry to 'problem_formatter_load_string'
libreport-2.17.15/src/lib/problem_report.c:1197:8: branch_true: following 'true' branch (when 'len != 0')...
libreport-2.17.15/src/lib/problem_report.c:1199:20: branch_true: ...to here
libreport-2.17.15/src/lib/problem_report.c:1199:20: acquire_memory: allocated here
libreport-2.17.15/src/lib/problem_report.c:1200:12: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libreport-2.17.15/src/lib/problem_report.c:1206:29: branch_false: ...to here
libreport-2.17.15/src/lib/problem_report.c:1206:29: call_function: calling 'load_stream' from 'problem_formatter_load_string'
#  205|   
#  206|       char *line;
#  207|->     while ((line = libreport_xmalloc_fgetline(fp)) != NULL)
#  208|       {
#  209|           /* Skip comments */

Error: COMPILER_WARNING (CWE-704): [#def92]
libreport-2.17.15/src/lib/problem_report.c: scope_hint: In function 'format_percented_string'
libreport-2.17.15/src/lib/problem_report.c:361:33: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  361 |             char *nextpercent = strchr(++str, '%');
#      |                                 ^~~~~~
#  359|               break;
#  360|           case '%': ;
#  361|->             char *nextpercent = strchr(++str, '%');
#  362|               if (!nextpercent)
#  363|               {

Error: COMPILER_WARNING (CWE-704): [#def93]
libreport-2.17.15/src/lib/problem_report.c:361:33: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  359|               break;
#  360|           case '%': ;
#  361|->             char *nextpercent = strchr(++str, '%');
#  362|               if (!nextpercent)
#  363|               {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
libreport-2.17.15/src/lib/report_result.c:179:9: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libreport-2.17.15/src/lib/report_result.c:169:18: enter_function: entry to 'report_result_new_with_label_from_env'
libreport-2.17.15/src/lib/report_result.c:177:8: branch_true: following 'true' branch (when 'workflow' is non-NULL)...
libreport-2.17.15/src/lib/report_result.c:179:28: call_function: inlined call to 'g_strdup_inline' from 'report_result_new_with_label_from_env'
libreport-2.17.15/src/lib/report_result.c:179:9: danger: dereference of NULL 'report_result_new_with_label(label)'
#  177|       if (NULL != workflow)
#  178|       {
#  179|->         result->workflow = g_strdup(workflow);
#  180|       }
#  181|   

Error: COMPILER_WARNING: [#def95]
libreport-2.17.15/src/lib/run_event.c: scope_hint: In function 'load_rule_list'
libreport-2.17.15/src/lib/run_event.c:153:9: warning[-Wunused-but-set-variable=]: variable 'line_counter' set but not used
#  153 |     int line_counter = 0;
#      |         ^~~~~~~~~~~~
#  151|   
#  152|       /* Used only for better warning message */
#  153|->     int line_counter = 0;
#  154|       /* Read and remember rules */
#  155|       char *next_line;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
libreport-2.17.15/src/lib/run_event.c:158:21: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(conf_file_name, "r")'
libreport-2.17.15/src/lib/run_event.c:803:7: enter_function: entry to 'list_possible_events_problem_data'
libreport-2.17.15/src/lib/run_event.c:805:12: call_function: calling '_list_possible_events' from 'list_possible_events_problem_data'
#  156|       while (1)
#  157|       {
#  158|->         next_line = libreport_xmalloc_fgetline(conffile);
#  159|           if(!next_line)
#  160|           {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
libreport-2.17.15/src/lib/run_event.c:158:21: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(conf_file_name, "r")'
libreport-2.17.15/src/lib/run_event.c:803:7: enter_function: entry to 'list_possible_events_problem_data'
libreport-2.17.15/src/lib/run_event.c:805:12: call_function: calling '_list_possible_events' from 'list_possible_events_problem_data'
#  156|       while (1)
#  157|       {
#  158|->         next_line = libreport_xmalloc_fgetline(conffile);
#  159|           if(!next_line)
#  160|           {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def98]
libreport-2.17.15/src/lib/spawn.c:111:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/null", 2)'
libreport-2.17.15/src/lib/spawn.c:81:12: branch_false: following 'false' branch (when 'child != -1')...
libreport-2.17.15/src/lib/spawn.c:84:12: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:84:12: branch_true: following 'true' branch (when 'child == 0')...
libreport-2.17.15/src/lib/spawn.c:87:20: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:104:20: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/spawn.c:110:28: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:110:27: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/spawn.c:111:25: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:111:25: acquire_resource: opened here
libreport-2.17.15/src/lib/spawn.c:111:25: danger: 'open("/dev/null", 2)' leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#  109|   			libreport_xmove_fd(pipe_to_child[0], STDIN_FILENO);
#  110|   		} else if (flags & EXECFLG_INPUT_NUL) {
#  111|-> 			libreport_xmove_fd(g_open("/dev/null", O_RDWR), STDIN_FILENO);
#  112|   		}
#  113|   		if (flags & EXECFLG_OUTPUT) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
libreport-2.17.15/src/lib/spawn.c:117:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/null", 2)'
libreport-2.17.15/src/lib/spawn.c:81:12: branch_false: following 'false' branch (when 'child != -1')...
libreport-2.17.15/src/lib/spawn.c:84:12: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:84:12: branch_true: following 'true' branch (when 'child == 0')...
libreport-2.17.15/src/lib/spawn.c:87:20: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:113:20: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/spawn.c:116:28: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:116:27: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/spawn.c:117:25: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:117:25: acquire_resource: opened here
libreport-2.17.15/src/lib/spawn.c:117:25: danger: 'open("/dev/null", 2)' leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  115|   			libreport_xmove_fd(pipe_fm_child[1], STDOUT_FILENO);
#  116|   		} else if (flags & EXECFLG_OUTPUT_NUL) {
#  117|-> 			libreport_xmove_fd(g_open("/dev/null", O_RDWR), STDOUT_FILENO);
#  118|   		}
#  119|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
libreport-2.17.15/src/lib/spawn.c:127:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/null", 2)'
libreport-2.17.15/src/lib/spawn.c:81:12: branch_false: following 'false' branch (when 'child != -1')...
libreport-2.17.15/src/lib/spawn.c:84:12: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:84:12: branch_true: following 'true' branch (when 'child == 0')...
libreport-2.17.15/src/lib/spawn.c:87:20: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:123:20: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/spawn.c:126:28: branch_false: ...to here
libreport-2.17.15/src/lib/spawn.c:126:27: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/spawn.c:127:25: branch_true: ...to here
libreport-2.17.15/src/lib/spawn.c:127:25: acquire_resource: opened here
libreport-2.17.15/src/lib/spawn.c:127:25: danger: 'open("/dev/null", 2)' leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  125|   			libreport_xdup2(STDOUT_FILENO, STDERR_FILENO);
#  126|   		} else if (flags & EXECFLG_ERR_NUL) {
#  127|-> 			libreport_xmove_fd(g_open("/dev/null", O_RDWR), STDERR_FILENO);
#  128|   		}
#  129|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
libreport-2.17.15/src/lib/stdio_helpers.c:40:46: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
libreport-2.17.15/src/lib/stdio_helpers.c:85:7: enter_function: entry to 'libreport_xmalloc_fopen_fgetline_fclose'
libreport-2.17.15/src/lib/stdio_helpers.c:88:16: acquire_resource: opened here
libreport-2.17.15/src/lib/stdio_helpers.c:89:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/stdio_helpers.c:91:13: branch_true: ...to here
libreport-2.17.15/src/lib/stdio_helpers.c:91:13: call_function: calling 'libreport_xmalloc_fgetline' from 'libreport_xmalloc_fopen_fgetline_fclose'
#   38|   		char *r;
#   39|   
#   40|-> 		linebuf = g_realloc(linebuf, idx + 0x100);
#   41|   		r = fgets(&linebuf[idx], 0x100, file);
#   42|   		if (!r) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
libreport-2.17.15/src/lib/stdio_helpers.c:40:46: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
libreport-2.17.15/src/lib/stdio_helpers.c:85:7: enter_function: entry to 'libreport_xmalloc_fopen_fgetline_fclose'
libreport-2.17.15/src/lib/stdio_helpers.c:88:16: acquire_memory: allocated here
libreport-2.17.15/src/lib/stdio_helpers.c:89:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/stdio_helpers.c:91:13: branch_true: ...to here
libreport-2.17.15/src/lib/stdio_helpers.c:91:13: call_function: calling 'libreport_xmalloc_fgetline' from 'libreport_xmalloc_fopen_fgetline_fclose'
#   38|   		char *r;
#   39|   
#   40|-> 		linebuf = g_realloc(linebuf, idx + 0x100);
#   41|   		r = fgets(&linebuf[idx], 0x100, file);
#   42|   		if (!r) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def103]
libreport-2.17.15/src/lib/strbuf.c:133:35: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libreport-2.17.15/src/lib/strbuf.c:138:10: enter_function: entry to 'libreport_strbuf_prepend_strf'
libreport-2.17.15/src/lib/strbuf.c:142:5: acquire_resource: 'va_start' called here
libreport-2.17.15/src/lib/strbuf.c:143:5: call_function: calling 'libreport_strbuf_prepend_strfv' from 'libreport_strbuf_prepend_strf'
#  131|   GString *libreport_strbuf_prepend_strfv(GString *strbuf, const char *format, va_list p)
#  132|   {
#  133|->     g_autofree char *string_ptr = libreport_xvasprintf(format, p);
#  134|       g_string_prepend(strbuf, string_ptr);
#  135|       return strbuf;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
libreport-2.17.15/src/lib/user_settings.c:124:28: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(cur_file, "r")'
libreport-2.17.15/src/lib/user_settings.c:107:8: enter_function: entry to 'libreport_load_words_from_file'
libreport-2.17.15/src/lib/user_settings.c:112:43: call_function: calling 'get_user_config_file_path' from 'libreport_load_words_from_file'
libreport-2.17.15/src/lib/user_settings.c:112:43: return_function: returning to 'libreport_load_words_from_file' from 'get_user_config_file_path'
libreport-2.17.15/src/lib/user_settings.c:115:11: branch_true: following 'true' branch (when 'file_list_cur' is non-NULL)...
libreport-2.17.15/src/lib/user_settings.c:117:15: branch_true: ...to here
libreport-2.17.15/src/lib/user_settings.c:118:20: acquire_resource: opened here
libreport-2.17.15/src/lib/user_settings.c:119:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/user_settings.c:119:12: branch_true: ...to here
libreport-2.17.15/src/lib/user_settings.c:124:28: throw: if 'libreport_xmalloc_fgetline' throws an exception...
libreport-2.17.15/src/lib/user_settings.c:124:28: danger: 'fopen(cur_file, "r")' leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  122|                */
#  123|               char *line;
#  124|->             while ((line = libreport_xmalloc_fgetline(fp)) != NULL)
#  125|               {
#  126|                   //FIXME: works only if the '#' is first char won't work for " #abcd#

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
libreport-2.17.15/src/lib/user_settings.c:124:28: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(cur_file, "r")'
libreport-2.17.15/src/lib/user_settings.c:107:8: enter_function: entry to 'libreport_load_words_from_file'
libreport-2.17.15/src/lib/user_settings.c:112:43: call_function: calling 'get_user_config_file_path' from 'libreport_load_words_from_file'
libreport-2.17.15/src/lib/user_settings.c:112:43: return_function: returning to 'libreport_load_words_from_file' from 'get_user_config_file_path'
libreport-2.17.15/src/lib/user_settings.c:115:11: branch_true: following 'true' branch (when 'file_list_cur' is non-NULL)...
libreport-2.17.15/src/lib/user_settings.c:117:15: branch_true: ...to here
libreport-2.17.15/src/lib/user_settings.c:118:20: acquire_memory: allocated here
libreport-2.17.15/src/lib/user_settings.c:119:12: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/user_settings.c:119:12: branch_true: ...to here
libreport-2.17.15/src/lib/user_settings.c:124:28: throw: if 'libreport_xmalloc_fgetline' throws an exception...
libreport-2.17.15/src/lib/user_settings.c:124:28: danger: 'fopen(cur_file, "r")' leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  122|                */
#  123|               char *line;
#  124|->             while ((line = libreport_xmalloc_fgetline(fp)) != NULL)
#  125|               {
#  126|                   //FIXME: works only if the '#' is first char won't work for " #abcd#

Error: GCC_ANALYZER_WARNING (CWE-688): [#def106]
libreport-2.17.15/src/lib/workflow_xml_parser.c:198:42: warning[-Wanalyzer-null-argument]: use of NULL 'parse_data.cur_locale' where non-null expected
libreport-2.17.15/src/lib/workflow_xml_parser.c:193:6: enter_function: entry to 'load_workflow_description_from_file'
libreport-2.17.15/src/lib/workflow_xml_parser.c:196:26: release_memory: 'parse_data.cur_locale' is NULL
libreport-2.17.15/src/lib/workflow_xml_parser.c:196:26: release_memory: 'parse_data.cur_locale' is NULL
libreport-2.17.15/src/lib/workflow_xml_parser.c:198:42: danger: argument 1 ('<unknown>') NULL where non-null expected
#  196|       struct my_parse_data parse_data = { workflow, NULL, NULL, 0, 0, 0};
#  197|       parse_data.cur_locale = g_strdup(setlocale(LC_ALL, NULL));
#  198|->     strchrnul(parse_data.cur_locale, '.')[0] = '\0';
#  199|   
#  200|       GMarkupParser parser;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r")'
libreport-2.17.15/src/lib/workflow_xml_parser.c:193:6: enter_function: entry to 'load_workflow_description_from_file'
libreport-2.17.15/src/lib/workflow_xml_parser.c:212:17: acquire_resource: opened here
libreport-2.17.15/src/lib/workflow_xml_parser.c:213:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/workflow_xml_parser.c:213:8: branch_true: ...to here
libreport-2.17.15/src/lib/workflow_xml_parser.c:217:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: branch_true: ...to here
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: throw: if 'g_markup_parse_context_parse' throws an exception...
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: danger: 'fopen(filename, "r")' leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  217|           while ((read_bytes = fread(buff, 1, 1024, fin)) != 0)
#  218|           {
#  219|->             g_markup_parse_context_parse(context, buff, read_bytes, NULL);
#  220|           }
#  221|           fclose(fin);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r")'
libreport-2.17.15/src/lib/workflow_xml_parser.c:193:6: enter_function: entry to 'load_workflow_description_from_file'
libreport-2.17.15/src/lib/workflow_xml_parser.c:212:17: acquire_memory: allocated here
libreport-2.17.15/src/lib/workflow_xml_parser.c:213:8: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/workflow_xml_parser.c:213:8: branch_true: ...to here
libreport-2.17.15/src/lib/workflow_xml_parser.c:217:16: branch_true: following 'true' branch...
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: branch_true: ...to here
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: throw: if 'g_markup_parse_context_parse' throws an exception...
libreport-2.17.15/src/lib/workflow_xml_parser.c:219:13: danger: 'fopen(filename, "r")' leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  217|           while ((read_bytes = fread(buff, 1, 1024, fin)) != 0)
#  218|           {
#  219|->             g_markup_parse_context_parse(context, buff, read_bytes, NULL);
#  220|           }
#  221|           fclose(fin);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
libreport-2.17.15/src/lib/xfuncs.c:74:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(from,  to)'
libreport-2.17.15/src/lib/xfuncs.c:74:9: acquire_resource: opened here
libreport-2.17.15/src/lib/xfuncs.c:74:8: danger: 'dup2(from,  to)' leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   72|   void libreport_xdup2(int from, int to)
#   73|   {
#   74|->     if (dup2(from, to) != to)
#   75|           perror_msg_and_die("Can't duplicate file descriptor");
#   76|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
libreport-2.17.15/src/lib/xfuncs.c:230:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(dirname, 65536)'
libreport-2.17.15/src/lib/xfuncs.c:243:18: acquire_resource: opened here
libreport-2.17.15/src/lib/xfuncs.c:244:8: branch_false: following 'false' branch...
libreport-2.17.15/src/lib/xfuncs.c:246:13: branch_false: ...to here
libreport-2.17.15/src/lib/xfuncs.c:230:9: danger: 'open(dirname, 65536)' leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  228|   int libreport_is_regular_file_at(struct dirent *dent, int dir_fd)
#  229|   {
#  230|->     if (dent->d_type == DT_REG)
#  231|           return 1;
#  232|       if (dent->d_type != DT_UNKNOWN)

Error: COMPILER_WARNING (CWE-704): [#def111]
libreport-2.17.15/src/plugins/reporter-bugzilla.c: scope_hint: In function ‘set_settings’
libreport-2.17.15/src/plugins/reporter-bugzilla.c:125:28: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  125 |         char *last_slash = strrchr(b->b_bugzilla_url, '/');
#      |                            ^~~~~~~
#  123|       {
#  124|           /* We don't want trailing '/': "https://host/dir/" -> "https://host/dir" */
#  125|->         char *last_slash = strrchr(b->b_bugzilla_url, '/');
#  126|           if (last_slash && last_slash[1] == '\0')
#  127|               *last_slash = '\0';

Error: COMPILER_WARNING (CWE-704): [#def112]
libreport-2.17.15/src/plugins/reporter-bugzilla.c:125:28: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  123|       {
#  124|           /* We don't want trailing '/': "https://host/dir/" -> "https://host/dir" */
#  125|->         char *last_slash = strrchr(b->b_bugzilla_url, '/');
#  126|           if (last_slash && last_slash[1] == '\0')
#  127|               *last_slash = '\0';

Error: COMPILER_WARNING (CWE-477): [#def113]
libreport-2.17.15/src/plugins/reporter-kerneloops.c: scope_hint: In function ‘http_post_to_kerneloops_site’
libreport-2.17.15/src/plugins/reporter-kerneloops.c:51:5: warning[-Wdeprecated-declarations]: ‘curl_formadd’ is deprecated: since 7.56.0. Use curl_mime_init()
#   51 |     curl_formadd(&post, &last,
#      |     ^~~~~~~~~~~~
libreport-2.17.15/src/include/libreport_curl.h:22: included_from: Included from here.
libreport-2.17.15/src/plugins/reporter-kerneloops.c:19: included_from: Included from here.
/usr/include/curl/curl.h:2628:1: note: declared here
# 2628 | curl_formadd(struct curl_httppost **httppost,
#      | ^~~~~~~~~~~~
#   49|       curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
#   50|   
#   51|->     curl_formadd(&post, &last,
#   52|               CURLFORM_COPYNAME, "oopsdata",
#   53|               CURLFORM_COPYCONTENTS, oopsdata,

Error: COMPILER_WARNING (CWE-477): [#def114]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:51:5: warning[-Wdeprecated-declarations]: ‘curl_formadd’ is deprecated: since 7.56.0. Use curl_mime_init()
#   49|       curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers);
#   50|   
#   51|->     curl_formadd(&post, &last,
#   52|               CURLFORM_COPYNAME, "oopsdata",
#   53|               CURLFORM_COPYCONTENTS, oopsdata,

Error: COMPILER_WARNING (CWE-477): [#def115]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:52:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYNAME’ is deprecated: since 7.56.0. Use curl_mime_name()
#   52 |             CURLFORM_COPYNAME, "oopsdata",
#      |             ^~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2553:3: note: declared here
# 2553 |   CURLFORM_COPYNAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
#      |   ^~~~~~~~~~~~~~~~~
#   50|   
#   51|       curl_formadd(&post, &last,
#   52|->             CURLFORM_COPYNAME, "oopsdata",
#   53|               CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def116]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:52:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYNAME’ is deprecated: since 7.56.0. Use curl_mime_name()
#   50|   
#   51|       curl_formadd(&post, &last,
#   52|->             CURLFORM_COPYNAME, "oopsdata",
#   53|               CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def117]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:53:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYCONTENTS’ is deprecated: since 7.56.0. Use curl_mime_data()
#   53 |             CURLFORM_COPYCONTENTS, oopsdata,
#      |             ^~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2556:3: note: declared here
# 2556 |   CURLFORM_COPYCONTENTS    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
#      |   ^~~~~~~~~~~~~~~~~~~~~
#   51|       curl_formadd(&post, &last,
#   52|               CURLFORM_COPYNAME, "oopsdata",
#   53|->             CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);
#   55|       curl_formadd(&post, &last,

Error: COMPILER_WARNING (CWE-477): [#def118]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:53:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYCONTENTS’ is deprecated: since 7.56.0. Use curl_mime_data()
#   51|       curl_formadd(&post, &last,
#   52|               CURLFORM_COPYNAME, "oopsdata",
#   53|->             CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);
#   55|       curl_formadd(&post, &last,

Error: COMPILER_WARNING (CWE-477): [#def119]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:55:5: warning[-Wdeprecated-declarations]: ‘curl_formadd’ is deprecated: since 7.56.0. Use curl_mime_init()
#   55 |     curl_formadd(&post, &last,
#      |     ^~~~~~~~~~~~
/usr/include/curl/curl.h:2628:1: note: declared here
# 2628 | curl_formadd(struct curl_httppost **httppost,
#      | ^~~~~~~~~~~~
#   53|               CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);
#   55|->     curl_formadd(&post, &last,
#   56|               CURLFORM_COPYNAME, "pass_on_allowed",
#   57|               CURLFORM_COPYCONTENTS, "yes",

Error: COMPILER_WARNING (CWE-477): [#def120]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:55:5: warning[-Wdeprecated-declarations]: ‘curl_formadd’ is deprecated: since 7.56.0. Use curl_mime_init()
#   53|               CURLFORM_COPYCONTENTS, oopsdata,
#   54|               CURLFORM_END);
#   55|->     curl_formadd(&post, &last,
#   56|               CURLFORM_COPYNAME, "pass_on_allowed",
#   57|               CURLFORM_COPYCONTENTS, "yes",

Error: COMPILER_WARNING (CWE-477): [#def121]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:56:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYNAME’ is deprecated: since 7.56.0. Use curl_mime_name()
#   56 |             CURLFORM_COPYNAME, "pass_on_allowed",
#      |             ^~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2553:3: note: declared here
# 2553 |   CURLFORM_COPYNAME        CURL_DEPRECATED(7.56.0, "Use curl_mime_name()"),
#      |   ^~~~~~~~~~~~~~~~~
#   54|               CURLFORM_END);
#   55|       curl_formadd(&post, &last,
#   56|->             CURLFORM_COPYNAME, "pass_on_allowed",
#   57|               CURLFORM_COPYCONTENTS, "yes",
#   58|               CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def122]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:56:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYNAME’ is deprecated: since 7.56.0. Use curl_mime_name()
#   54|               CURLFORM_END);
#   55|       curl_formadd(&post, &last,
#   56|->             CURLFORM_COPYNAME, "pass_on_allowed",
#   57|               CURLFORM_COPYCONTENTS, "yes",
#   58|               CURLFORM_END);

Error: COMPILER_WARNING (CWE-477): [#def123]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:57:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYCONTENTS’ is deprecated: since 7.56.0. Use curl_mime_data()
#   57 |             CURLFORM_COPYCONTENTS, "yes",
#      |             ^~~~~~~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:2556:3: note: declared here
# 2556 |   CURLFORM_COPYCONTENTS    CURL_DEPRECATED(7.56.0, "Use curl_mime_data()"),
#      |   ^~~~~~~~~~~~~~~~~~~~~
#   55|       curl_formadd(&post, &last,
#   56|               CURLFORM_COPYNAME, "pass_on_allowed",
#   57|->             CURLFORM_COPYCONTENTS, "yes",
#   58|               CURLFORM_END);
#   59|   

Error: COMPILER_WARNING (CWE-477): [#def124]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:57:13: warning[-Wdeprecated-declarations]: ‘CURLFORM_COPYCONTENTS’ is deprecated: since 7.56.0. Use curl_mime_data()
#   55|       curl_formadd(&post, &last,
#   56|               CURLFORM_COPYNAME, "pass_on_allowed",
#   57|->             CURLFORM_COPYCONTENTS, "yes",
#   58|               CURLFORM_END);
#   59|   

Error: COMPILER_WARNING (CWE-477): [#def125]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:60:5: warning[-Wdeprecated-declarations]: ‘CURLOPT_HTTPPOST’ is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#   60 |     curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
#      |     ^~~~~~~~~~~~~~~~
/usr/include/curl/curl.h:1231:3: note: declared here
# 1231 |   CURLOPTDEPRECATED(CURLOPT_HTTPPOST, CURLOPTTYPE_OBJECTPOINT, 24,
#      |   ^~~~~~~~~~~~~~~~~
#   58|               CURLFORM_END);
#   59|   
#   60|->     curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
#   61|       curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction);
#   62|   

Error: COMPILER_WARNING (CWE-477): [#def126]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:60:5: warning[-Wdeprecated-declarations]: ‘CURLOPT_HTTPPOST’ is deprecated: since 7.56.0. Use CURLOPT_MIMEPOST
#   58|               CURLFORM_END);
#   59|   
#   60|->     curl_easy_setopt(handle, CURLOPT_HTTPPOST, post);
#   61|       curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, writefunction);
#   62|   

Error: COMPILER_WARNING (CWE-477): [#def127]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:65:5: warning[-Wdeprecated-declarations]: ‘curl_formfree’ is deprecated: since 7.56.0. Use curl_mime_free()
#   65 |     curl_formfree(post);
#      |     ^~~~~~~~~~~~~
/usr/include/curl/curl.h:2664:1: note: declared here
# 2664 | curl_formfree(struct curl_httppost *form);
#      | ^~~~~~~~~~~~~
#   63|       ret = curl_easy_perform_with_proxy(handle, url);
#   64|   
#   65|->     curl_formfree(post);
#   66|       curl_slist_free_all(headers);
#   67|       curl_easy_cleanup(handle);

Error: COMPILER_WARNING (CWE-477): [#def128]
libreport-2.17.15/src/plugins/reporter-kerneloops.c:65:5: warning[-Wdeprecated-declarations]: ‘curl_formfree’ is deprecated: since 7.56.0. Use curl_mime_free()
#   63|       ret = curl_easy_perform_with_proxy(handle, url);
#   64|   
#   65|->     curl_formfree(post);
#   66|       curl_slist_free_all(headers);
#   67|       curl_easy_cleanup(handle);

Error: COMPILER_WARNING (CWE-704): [#def129]
libreport-2.17.15/src/plugins/reporter-mantisbt.c: scope_hint: In function ‘set_settings’
libreport-2.17.15/src/plugins/reporter-mantisbt.c:145:28: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  145 |         char *last_slash = strrchr(m->m_mantisbt_url, '/');
#      |                            ^~~~~~~
#  143|       {
#  144|           /* We don't want trailing '/': "https://host/dir/" -> "https://host/dir" */
#  145|->         char *last_slash = strrchr(m->m_mantisbt_url, '/');
#  146|           if (last_slash && last_slash[1] == '\0')
#  147|               *last_slash = '\0';

Error: COMPILER_WARNING (CWE-704): [#def130]
libreport-2.17.15/src/plugins/reporter-mantisbt.c:145:28: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  143|       {
#  144|           /* We don't want trailing '/': "https://host/dir/" -> "https://host/dir" */
#  145|->         char *last_slash = strrchr(m->m_mantisbt_url, '/');
#  146|           if (last_slash && last_slash[1] == '\0')
#  147|               *last_slash = '\0';

Error: COMPILER_WARNING (CWE-704): [#def131]
libreport-2.17.15/src/plugins/reporter-systemd-journal.c: scope_hint: In function ‘main’
libreport-2.17.15/src/plugins/reporter-systemd-journal.c:304:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  304 |         binary_name = strrchr(exe, '/');
#      |                     ^
#  302|       char *binary_name = NULL;
#  303|       if (exe)
#  304|->         binary_name = strrchr(exe, '/');
#  305|   
#  306|       if (binary_name && ++binary_name)

Error: COMPILER_WARNING (CWE-704): [#def132]
libreport-2.17.15/src/plugins/reporter-systemd-journal.c:304:21: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  302|       char *binary_name = NULL;
#  303|       if (exe)
#  304|->         binary_name = strrchr(exe, '/');
#  305|   
#  306|       if (binary_name && ++binary_name)

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-116.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibreport-2.17.15-9.fc44
store-results-to/tmp/tmp1dkjox4x/libreport-2.17.15-9.fc44.tar.xz
time-created2026-01-08 19:12:08
time-finished2026-01-08 19:14:51
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp1dkjox4x/libreport-2.17.15-9.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp1dkjox4x/libreport-2.17.15-9.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9