Fixed defects

List of Defects

Error: COMPILER_WARNING: [#def1]
libical-3.0.17-build/libical-3.0.17/src/libical/icalparser.c: scope_hint: In function ‘icalparser_string_line_generator’
libical-3.0.17-build/libical-3.0.17/src/libical/icalparser.c:1366:5: warning[-Wstringop-truncation]: ‘strncpy’ specified bound depends on the length of the source argument
# 1366 |     strncpy(out, data->pos, size);
#      |     ^
libical-3.0.17-build/libical-3.0.17/src/libical/icalparser.c:1351:20: note: length computed here
# 1351 |             size = strlen(data->pos);
#      |                    ^~~~~~~~~~~~~~~~~
# 1364|       }
# 1365|   
# 1366|->     strncpy(out, data->pos, size);
# 1367|   
# 1368|       if(replace_cr) {

Error: COMPILER_WARNING: [#def2]
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c: scope_hint: In function ‘icaltimezone_dump_changes’
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c:2011:46: warning[-Wformat-truncation=]: ‘%02i’ directive output may be truncated writing 2 bytes into a region of size between 1 and 5
# 2011 |         snprintf(buffer, buffer_size, "%s%02i%02i", sign, hours, minutes);
#      |                                              ^~~~
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c:2011:39: note: directive argument in the range [0, 59]
# 2011 |         snprintf(buffer, buffer_size, "%s%02i%02i", sign, hours, minutes);
#      |                                       ^~~~~~~~~~~~
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 6 and 10 bytes into a destination of size 8
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
# 2009|   
# 2010|       if (seconds == 0) {
# 2011|->         snprintf(buffer, buffer_size, "%s%02i%02i", sign, hours, minutes);
# 2012|       } else {
# 2013|           snprintf(buffer, buffer_size, "%s%02i%02i%02i", sign, hours, minutes, seconds);

Error: COMPILER_WARNING: [#def3]
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c: scope_hint: In function ‘icaltimezone_dump_changes’
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c:2013:46: warning[-Wformat-truncation=]: ‘%02i’ directive output may be truncated writing 2 bytes into a region of size between 1 and 5
# 2013 |         snprintf(buffer, buffer_size, "%s%02i%02i%02i", sign, hours, minutes, seconds);
#      |                                              ^~~~
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c:2013:39: note: directive argument in the range [0, 59]
# 2013 |         snprintf(buffer, buffer_size, "%s%02i%02i%02i", sign, hours, minutes, seconds);
#      |                                       ^~~~~~~~~~~~~~~~
libical-3.0.17-build/libical-3.0.17/src/libical/icaltimezone.c:2013:39: note: directive argument in the range [1, 59]
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 8 and 12 bytes into a destination of size 8
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
# 2011|           snprintf(buffer, buffer_size, "%s%02i%02i", sign, hours, minutes);
# 2012|       } else {
# 2013|->         snprintf(buffer, buffer_size, "%s%02i%02i%02i", sign, hours, minutes, seconds);
# 2014|       }
# 2015|   }

Error: COMPILER_WARNING: [#def4]
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c:990:13: warning[-Wstringop-truncation]: ‘__strncat_chk’ output may be truncated copying 7 bytes from a string of length 19
#  990 |             strncat(str, temp, 7);
#      |             ^
#  988|           if (icaltime_is_utc(*data)) {
#  989|               snprintf(temp, sizeof(temp), "%02d%02d%02dZ", data->hour, data->minute, data->second);
#  990|->             strncat(str, temp, 7);
#  991|           } else {
#  992|               snprintf(temp, sizeof(temp), "%02d%02d%02d", data->hour, data->minute, data->second);

Error: COMPILER_WARNING: [#def5]
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c: scope_hint: In function ‘print_datetime_to_string’
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c:993:13: warning[-Wstringop-truncation]: ‘__strncat_chk’ output may be truncated copying 6 bytes from a string of length 19
#  993 |             strncat(str, temp, 6);
#      |             ^
#  991|           } else {
#  992|               snprintf(temp, sizeof(temp), "%02d%02d%02d", data->hour, data->minute, data->second);
#  993|->             strncat(str, temp, 6);
#  994|           }
#  995|       }

Error: COMPILER_WARNING: [#def6]
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c: scope_hint: In function ‘print_date_to_string.part.0.constprop.0.isra.0’
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c:1006:9: warning[-Wstringop-truncation]: ‘strncat’ output may be truncated copying 8 bytes from a string of length 19
# 1006 |         strncat(str, temp, 8);
#      |         ^
# 1004|       if (data != 0) {
# 1005|           snprintf(temp, sizeof(temp), "%04d%02d%02d", data->year, data->month, data->day);
# 1006|->         strncat(str, temp, 8);
# 1007|       }
# 1008|   }

Error: COMPILER_WARNING: [#def7]
libical-3.0.17-build/libical-3.0.17/src/libical/icalvalue.c:1038:13: warning[-Wstringop-truncation]: ‘strncat’ output may be truncated copying 19 bytes from a string of length 19
# 1038 |             strncat(str, temp, 19);
#      |             ^
# 1036|               temp[0] = '\0';
# 1037|               print_time_to_string(temp, data);
# 1038|->             strncat(str, temp, 19);
# 1039|           }
# 1040|       }

Error: COMPILER_WARNING: [#def8]
libical-3.0.17-build/libical-3.0.17/src/libical/sspm.c: scope_hint: In function ‘sspm_write_part.isra.0’
libical-3.0.17-build/libical-3.0.17/src/libical/sspm.c:1209:34: warning[-Wformat-truncation=]: ‘%02X’ directive output may be truncated writing between 2 and 8 bytes into a region of size 3
# 1209 |     snprintf(tmp, sizeof(tmp), "=%02X", (unsigned int)ch);
#      |                                  ^~~~
libical-3.0.17-build/libical-3.0.17/src/libical/sspm.c:1209:32: note: directive argument in the range [1, 4294967295]
# 1209 |     snprintf(tmp, sizeof(tmp), "=%02X", (unsigned int)ch);
#      |                                ^~~~~~~
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 4 and 10 bytes into a destination of size 4
#   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
#      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   69 |                                    __glibc_objsize (__s), __fmt,
#      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   70 |                                    __va_arg_pack ());
#      |                                    ~~~~~~~~~~~~~~~~~
# 1207|       char tmp[4];
# 1208|   
# 1209|->     snprintf(tmp, sizeof(tmp), "=%02X", (unsigned int)ch);
# 1210|   
# 1211|       sspm_append_string(buf, tmp);

Error: COMPILER_WARNING: [#def9]
libical-3.0.17-build/libical-3.0.17/src/libicalvcal/vobject.c: scope_hint: In function ‘writeGroup’
libical-3.0.17-build/libical-3.0.17/src/libicalvcal/vobject.c:1265:9: warning[-Wstringop-truncation]: ‘__strncat_chk’ output may be truncated copying between 0 and 255 bytes from a string of length 255
# 1265 |         strncat(buf2,buf1,sizeof(buf2)-strlen(buf2)-1);
#      |         ^
# 1263|           buf2[sizeof(buf2)-1] = '\0';
# 1264|           strncat(buf2,".",sizeof(buf2)-strlen(buf2)-1);
# 1265|->         strncat(buf2,buf1,sizeof(buf2)-strlen(buf2)-1);
# 1266|           strcpy(buf1,buf2);
# 1267|           }

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-185.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namelibical-3.0.18-1.fc41
diffbase-store-results-to/tmp/tmpxlu0657d/libical-3.0.18-1.fc41.tar.xz
diffbase-time-created2024-07-03 14:46:45
diffbase-time-finished2024-07-03 14:50:13
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpxlu0657d/libical-3.0.18-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpxlu0657d/libical-3.0.18-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-185.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibical-3.0.17-4.fc40
store-results-to/tmp/tmpj_wjqfzp/libical-3.0.17-4.fc40.tar.xz
time-created2024-07-03 14:42:42
time-finished2024-07-03 14:46:35
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpj_wjqfzp/libical-3.0.17-4.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpj_wjqfzp/libical-3.0.17-4.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9