Task #740 - ed-1.20.1-1.fc40/scan-results.err

back to task #740
download
Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/buffer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-416):
ed-1.20.1-build/ed-1.20.1/buffer.c:71:39: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘yank_buffer_head.q_forw’
ed-1.20.1-build/ed-1.20.1/buffer.c: scope_hint: In function ‘yank_lines’
ed-1.20.1-build/ed-1.20.1/buffer.c: scope_hint: In function ‘yank_lines’
#   69|   /* link next and previous nodes */
#   70|   static void link_nodes( line_t * const prev, line_t * const next )
#   71|->   { prev->q_forw = next; next->q_back = prev; }
#   72|   
#   73|   

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/carg_parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-131):
ed-1.20.1-build/ed-1.20.1/global.c: scope_hint: In function ‘set_active_node’
ed-1.20.1-build/ed-1.20.1/global.c:74:17: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#   72|           set_error_msg( mem_msg ); enable_interrupts(); return false; }
#   73|       active_size = new_size;
#   74|->     active_list = (const line_t **)new_buf;
#   75|       enable_interrupts();
#   76|       }

Error: CLANG_WARNING:
ed-1.20.1-build/ed-1.20.1/global.c:94:10: warning[core.NullDereference]: Access to field 'q_forw' results in a dereference of a null pointer (loaded from variable 'bp')
#   92|           { active_list[active_idxm] = 0; break; }
#   93|         }
#   94|->     bp = bp->q_forw;
#   95|       }
#   96|     }

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/io.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-762):
ed-1.20.1-build/ed-1.20.1/io.c: scope_hint: In function ‘read_file’
ed-1.20.1-build/ed-1.20.1/io.c:295:57: warning[-Wanalyzer-mismatching-deallocation]: ‘fp’ should have been deallocated with ‘pclose’ but was deallocated with ‘fclose’
#  293|         set_error_msg( "Cannot open input file" ); return -1; }
#  294|     const long size = read_stream( filename, fp, addr );	/* file size in bytes */
#  295|->   if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
#  296|     if( size < 0 ) return -2;
#  297|     if( ret != 0 )

Error: GCC_ANALYZER_WARNING (CWE-762):
ed-1.20.1-build/ed-1.20.1/io.c: scope_hint: In function ‘write_file’
ed-1.20.1-build/ed-1.20.1/io.c:351:32: warning[-Wanalyzer-mismatching-deallocation]: ‘fp’ should have been deallocated with ‘fclose’ but was deallocated with ‘pclose’
#  349|         set_error_msg( "Cannot open output file" ); return -1; }
#  350|     const long size = write_stream( filename, fp, from, to );	/* bytes written */
#  351|->   if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
#  352|     if( size < 0 ) return -1;
#  353|     if( ret != 0 )

Error: GCC_ANALYZER_WARNING (CWE-762):
ed-1.20.1-build/ed-1.20.1/io.c:351:57: warning[-Wanalyzer-mismatching-deallocation]: ‘fp’ should have been deallocated with ‘pclose’ but was deallocated with ‘fclose’
#  349|         set_error_msg( "Cannot open output file" ); return -1; }
#  350|     const long size = write_stream( filename, fp, from, to );	/* bytes written */
#  351|->   if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
#  352|     if( size < 0 ) return -1;
#  353|     if( ret != 0 )

Error: GCC_ANALYZER_WARNING (CWE-775):
ed-1.20.1-build/ed-1.20.1/io.c:352:5: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
#  350|     const long size = write_stream( filename, fp, from, to );	/* bytes written */
#  351|     if( *filename == '!' ) ret = pclose( fp ); else ret = fclose( fp );
#  352|->   if( size < 0 ) return -1;
#  353|     if( ret != 0 )
#  354|       { show_strerror( filename, errno );

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/main.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/main_loop.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/regex.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING:
ed-1.20.1-build/ed-1.20.1/signal.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688):
ed-1.20.1-build/ed-1.20.1/signal.c: scope_hint: In function ‘home_directory’
ed-1.20.1-build/ed-1.20.1/signal.c:55:5: warning[-Wanalyzer-null-argument]: use of NULL ‘buf’ where non-null expected
ed-1.20.1-build/ed-1.20.1/signal.c:21: included_from: Included from here.
ed-1.20.1-build/ed-1.20.1/signal.c: scope_hint: In function ‘home_directory’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
#   53|       const int hdsize = strlen( hd );
#   54|       if( !resize_buffer( &buf, &bufsz, hdsize + 1 ) ) return 0;
#   55|->     memcpy( buf, hd, hdsize );
#   56|       buf[hdsize] = 0;
#   57|       }

Error: CLANG_WARNING:
ed-1.20.1-build/ed-1.20.1/signal.c:55:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#   53|       const int hdsize = strlen( hd );
#   54|       if( !resize_buffer( &buf, &bufsz, hdsize + 1 ) ) return 0;
#   55|->     memcpy( buf, hd, hdsize );
#   56|       buf[hdsize] = 0;
#   57|       }

Error: CLANG_WARNING:
ed-1.20.1-build/ed-1.20.1/signal.c:71:14: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
#   69|         write_file( hb, "w", 1, last_addr() ) >= 0 ) exit( 0 );
#   70|     const char * const hd = home_directory();
#   71|->   if( !hd || !hd[0] ) exit( 1 );
#   72|     const int hdsize = strlen( hd );
#   73|     const int need_slash = hd[hdsize-1] != '/';

Error: GCC_ANALYZER_WARNING (CWE-401):
ed-1.20.1-build/ed-1.20.1/signal.c: scope_hint: In function ‘sighup_handler.part.0’
ed-1.20.1-build/ed-1.20.1/signal.c:80:5: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc((long unsigned int)(hdsize + need_slash) + 7)’
ed-1.20.1-build/ed-1.20.1/signal.c: scope_hint: In function ‘sighup_handler.part.0’
#   78|     if( need_slash ) hup[hdsize] = '/';
#   79|     memcpy( hup + hdsize + need_slash, hb, sizeof hb );
#   80|->   if( write_file( hup, "w", 1, last_addr() ) >= 0 ) exit( 0 );
#   81|     exit( 1 );				/* hup file write failed */
#   82|     }