A short list of bug description:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
01.  src/commands.c:2409: (performance) Variable 'curname' is reassigned a
value before the old one has been used

Description: This will crash tvtime if we use command "tvtime-command
set_input_width 720"

This bug will be fixed if line 2404:

    const char *curname = menu_get_name( cmd->curusermenu );

will be removed.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
02.  src/leetft.c:81: (error) Memory leak: cur
03.  src/tvtime.c:1435: (error) Memory leak: colourbars
04.  src/tvtime.c:1435: (error) Memory leak: saveframe
05.  src/tvtime.c:1435: (error) Memory leak: fadeframe
06.  src/tvtime.c:1435: (error) Memory leak: blueframe
07.  src/tvtime.c:1485: (error) Memory leak: fadeframe
08.  src/tvtime.c:1304: (error) Memory leak: tvtime

Description: alocated memory isn't freed before function return value.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
09.  intl/localealias.c:306 (error) Resource leak: fp
10.  src/tvtimeconf.c:986: (error) Resource leak: fifofd
11.  src/tvtimeconf.c:1185: (error) Resource leak: fifofd

Description: open file isn't closed before function return value
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
12.  src/utils.c:130: (error) Resource leak: temp_dir

Description: open directory isn't closed before funtion return vale.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

13.  plugins/kdetv_greedyh.c:92: (error) Buffer is accessed out of bounds:
Picture
14.  plugins/kdetv_tomsmocomp.c:91: (error) Buffer

Description:

have

#define MAX_PICTURE_HISTORY 10

and then

    TPicture Picture[ 8 ;

    for( i = 0; i < MAX_PICTURE_HISTORY; i++ ) {
        Info.PictureHistory[ i  = &(Picture[ i );
    }

That's two more elements accessed than provided.
The code would be cleaner and guarded from errors like that if we used:

    TPicture Picture[ MAX_PICTURE_HISTORY ;

instead of the hardcoded 8.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

15.  src/station.c:1034: (warning) Dangerous usage of strncat - 3rd
parameter is the maximum number of characters to append
16.  src/station.c:1034: (error) Dangerous usage of 'filename' (strncpy
doesn't always null-terminate it).

My sugestion is to use memmove insted strncpy:

-    strncpy( filename, getenv( "HOME" ), 235 );
-    strncat( filename, "/.tvtime/stationlist.xml", 255 );

+    static const char config_filename[ = "/.tvtime/stationlist.xml";
+    const char *home = getenv( "HOME" );
+    size_t len = strlen( home );
+    if ( len > sizeof( filename ) - sizeof( config_filename ) )
+        fprintf( stderr, "station: station: Could not create new config
file. The file name will be to long\n" );
+    else {
+        memmove( filename, home, len );
+        memmove( filename + len, config_filename, sizeof( config_filename
) );
+    }
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
17.  src/tvtime.c:242: (warning) Assignment of function parameter has no
effect outside the function.
18.  src/tvtime.c:629: (warning) Assignment of function
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
19.  src/tvtime.c:2549: (warning) The buffer 'prevloc' may not be
null-terminated after the call to strncpy().
20.  src/tvtimeconf.c:393: (warning) The buffer 'prevloc'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
21.  intl/l10nflist.c:433 -> 23. intl/l10nflist.c:417: (error,
inconclusive) Possible null pointer dereference: retval - otherwise it is
      redundant to check it against null.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
22.  intl/localcharset.c:181: (error) Common realloc mistake: 'res_ptr'
nulled but not freed upon failure
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
23. plugins/greedyh.cpp:29: (warning) Member variable
'DScalerFilterGreedyH::GreedyMaxComb' is not initialized in the constructor.
24. plugins/greedyh.cpp:29: (warning) Member variable
'DScalerFilterGreedyH::GreedyMotionThreshold'
25. plugins/greedyh.cpp:29: (warning) Member variable
'DScalerFilterGreedyH::GreedyMotionSense'
26. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::SearchEffort'
27. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::UseStrangeBob'
28. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pMyMemcpy'
29. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::IsOdd'
30. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pWeaveSrc'
31. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pWeaveSrcP'
32. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pWeaveDest'
33. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pCopySrc'
34. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pCopySrcP'
35. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::pCopyDest'
36. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::src_pitch'
37. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::dst_pitch'
38. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::rowsize'
39. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::height'
40. plugins/tomsmocomp.cpp:29: (warning) Member variable
'DScalerFilterTomsMoComp::FldHeight'
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
41. src/commands.c:1944: (style) Statements following return, break,
continue, goto or throw will never be executed.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
42. src/cpuinfo.c:58: (style) Obsolete function 'usleep' called. It is
recommended to use the 'nanosleep' or 'setitimer' function instead.
43. src/tvtime.c:2130: (style) Obsolete function 'usleep' called.
44. src/tvtime.c:2378: (style) Obsolete function 'usleep' called.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
45. src/xcommon.c:1595: (warning) When using 'char' variables in bit
operations, sign extension can generate unexpected results.

Regards,

George

Reply via email to