Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linter: gosec, Rule: G115 - Potential integer overflow when converting between integer types. Should we enable it? #15798

Closed
zak-pawel opened this issue Sep 1, 2024 · 5 comments
Assignees
Labels

Comments

@zak-pawel
Copy link
Collaborator

Use Case

This issue starts discussion about enabling:

Rule is mapped to CWE-190: Integer Overflow or Wraparound.

Expected behavior

Decision if rule should be enabled or not.

Actual behavior

For this rule following findings were found in current code:

cmd/telegraf/cmd_secretstore.go:239:39                                      gosec  G115: integer overflow conversion uintptr -> int
internal/process/process.go:133:33                                          gosec  G115: integer overflow conversion int -> int32
internal/snmp/field.go:184:13                                               gosec  G115: integer overflow conversion uint -> int64
internal/snmp/field.go:192:13                                               gosec  G115: integer overflow conversion uint64 -> int64
internal/snmp/wrapper.go:191:18                                             gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:176:17                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:179:16                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:182:16                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:185:16                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:193:17                                         gosec  G115: integer overflow conversion int -> uint32
internal/type_conversions.go:195:16                                         gosec  G115: integer overflow conversion int -> uint32
internal/type_conversions.go:213:17                                         gosec  G115: integer overflow conversion int64 -> uint32
internal/type_conversions.go:215:16                                         gosec  G115: integer overflow conversion int64 -> uint32
internal/type_conversions.go:217:16                                         gosec  G115: integer overflow conversion uint -> uint32
internal/type_conversions.go:226:17                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:228:16                                         gosec  G115: integer overflow conversion uint64 -> uint32
internal/type_conversions.go:250:17                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:253:16                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:256:16                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:259:16                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:267:17                                         gosec  G115: integer overflow conversion int -> uint16
internal/type_conversions.go:269:16                                         gosec  G115: integer overflow conversion int -> uint16
internal/type_conversions.go:282:17                                         gosec  G115: integer overflow conversion int32 -> uint16
internal/type_conversions.go:284:16                                         gosec  G115: integer overflow conversion int32 -> uint16
internal/type_conversions.go:287:17                                         gosec  G115: integer overflow conversion int64 -> uint16
internal/type_conversions.go:289:16                                         gosec  G115: integer overflow conversion int64 -> uint16
internal/type_conversions.go:291:16                                         gosec  G115: integer overflow conversion uint -> uint16
internal/type_conversions.go:298:17                                         gosec  G115: integer overflow conversion uint32 -> uint16
internal/type_conversions.go:300:16                                         gosec  G115: integer overflow conversion uint32 -> uint16
internal/type_conversions.go:303:17                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:305:16                                         gosec  G115: integer overflow conversion uint64 -> uint16
internal/type_conversions.go:327:16                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:330:15                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:333:15                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:336:15                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:344:16                                         gosec  G115: integer overflow conversion int -> uint8
internal/type_conversions.go:346:15                                         gosec  G115: integer overflow conversion int -> uint8
internal/type_conversions.go:359:16                                         gosec  G115: integer overflow conversion int32 -> uint8
internal/type_conversions.go:361:15                                         gosec  G115: integer overflow conversion int32 -> uint8
internal/type_conversions.go:364:16                                         gosec  G115: integer overflow conversion int64 -> uint8
internal/type_conversions.go:366:15                                         gosec  G115: integer overflow conversion int64 -> uint8
internal/type_conversions.go:368:15                                         gosec  G115: integer overflow conversion uint -> uint8
internal/type_conversions.go:373:16                                         gosec  G115: integer overflow conversion uint16 -> uint8
internal/type_conversions.go:375:15                                         gosec  G115: integer overflow conversion uint16 -> uint8
internal/type_conversions.go:378:16                                         gosec  G115: integer overflow conversion uint32 -> uint8
internal/type_conversions.go:380:15                                         gosec  G115: integer overflow conversion uint32 -> uint8
internal/type_conversions.go:383:16                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:385:15                                         gosec  G115: integer overflow conversion uint64 -> uint8
internal/type_conversions.go:430:16                                         gosec  G115: integer overflow conversion uint -> int64
internal/type_conversions.go:432:15                                         gosec  G115: integer overflow conversion uint -> int64
internal/type_conversions.go:441:16                                         gosec  G115: integer overflow conversion uint64 -> int64
internal/type_conversions.go:443:15                                         gosec  G115: integer overflow conversion uint64 -> int64
internal/type_conversions.go:465:16                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:468:15                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:471:15                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:474:15                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:482:16                                         gosec  G115: integer overflow conversion int -> int32
internal/type_conversions.go:484:15                                         gosec  G115: integer overflow conversion int -> int32
internal/type_conversions.go:493:16                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:495:15                                         gosec  G115: integer overflow conversion int64 -> int32
internal/type_conversions.go:498:16                                         gosec  G115: integer overflow conversion uint -> int32
internal/type_conversions.go:500:15                                         gosec  G115: integer overflow conversion uint -> int32
internal/type_conversions.go:507:16                                         gosec  G115: integer overflow conversion uint32 -> int32
internal/type_conversions.go:509:15                                         gosec  G115: integer overflow conversion uint32 -> int32
internal/type_conversions.go:512:16                                         gosec  G115: integer overflow conversion uint64 -> int32
internal/type_conversions.go:514:15                                         gosec  G115: integer overflow conversion uint64 -> int32
internal/type_conversions.go:536:16                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:539:15                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:542:15                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:545:15                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:552:15                                         gosec  G115: integer overflow conversion int -> int16
internal/type_conversions.go:559:16                                         gosec  G115: integer overflow conversion int32 -> int16
internal/type_conversions.go:561:15                                         gosec  G115: integer overflow conversion int32 -> int16
internal/type_conversions.go:564:16                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:566:15                                         gosec  G115: integer overflow conversion int64 -> int16
internal/type_conversions.go:569:16                                         gosec  G115: integer overflow conversion uint -> int16
internal/type_conversions.go:571:15                                         gosec  G115: integer overflow conversion uint -> int16
internal/type_conversions.go:576:16                                         gosec  G115: integer overflow conversion uint16 -> int16
internal/type_conversions.go:578:15                                         gosec  G115: integer overflow conversion uint16 -> int16
internal/type_conversions.go:581:16                                         gosec  G115: integer overflow conversion uint32 -> int16
internal/type_conversions.go:583:15                                         gosec  G115: integer overflow conversion uint32 -> int16
internal/type_conversions.go:586:16                                         gosec  G115: integer overflow conversion uint64 -> int16
internal/type_conversions.go:588:15                                         gosec  G115: integer overflow conversion uint64 -> int16
internal/type_conversions.go:610:15                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:613:14                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:616:14                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:619:14                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:626:14                                         gosec  G115: integer overflow conversion int -> int8
internal/type_conversions.go:631:15                                         gosec  G115: integer overflow conversion int16 -> int8
internal/type_conversions.go:633:14                                         gosec  G115: integer overflow conversion int16 -> int8
internal/type_conversions.go:636:15                                         gosec  G115: integer overflow conversion int32 -> int8
internal/type_conversions.go:638:14                                         gosec  G115: integer overflow conversion int32 -> int8
internal/type_conversions.go:641:15                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:643:14                                         gosec  G115: integer overflow conversion int64 -> int8
internal/type_conversions.go:646:15                                         gosec  G115: integer overflow conversion uint -> int8
internal/type_conversions.go:648:14                                         gosec  G115: integer overflow conversion uint -> int8
internal/type_conversions.go:651:15                                         gosec  G115: integer overflow conversion uint8 -> int8
internal/type_conversions.go:653:14                                         gosec  G115: integer overflow conversion uint8 -> int8
internal/type_conversions.go:656:15                                         gosec  G115: integer overflow conversion uint16 -> int8
internal/type_conversions.go:658:14                                         gosec  G115: integer overflow conversion uint16 -> int8
internal/type_conversions.go:661:15                                         gosec  G115: integer overflow conversion uint32 -> int8
internal/type_conversions.go:663:14                                         gosec  G115: integer overflow conversion uint32 -> int8
internal/type_conversions.go:666:15                                         gosec  G115: integer overflow conversion uint64 -> int8
internal/type_conversions.go:668:14                                         gosec  G115: integer overflow conversion uint64 -> int8
models/buffer_disk.go:60:12                                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/aggregators/quantile/quantile_test.go:93:16                         gosec  G115: integer overflow conversion int -> int32
plugins/aggregators/quantile/quantile_test.go:95:17                         gosec  G115: integer overflow conversion int -> uint32
plugins/aggregators/quantile/quantile_test.go:225:16                        gosec  G115: integer overflow conversion int -> int32
plugins/aggregators/quantile/quantile_test.go:227:17                        gosec  G115: integer overflow conversion int -> uint32
plugins/aggregators/quantile/quantile_test.go:357:16                        gosec  G115: integer overflow conversion int -> int32
plugins/aggregators/quantile/quantile_test.go:359:17                        gosec  G115: integer overflow conversion int -> uint32
plugins/common/kafka/config.go:46:52                                        gosec  G115: integer overflow conversion int -> int16
plugins/common/kafka/config.go:102:55                                       gosec  G115: integer overflow conversion int -> int8
plugins/common/mqtt/mqtt_v5.go:32:25                                        gosec  G115: integer overflow conversion int64 -> uint16
plugins/common/opcua/client.go:163:42                                       gosec  G115: integer overflow conversion uint64 -> uint32
plugins/common/socket/datagram.go:130:29                                    gosec  G115: integer overflow conversion uint64 -> uint32
plugins/common/socket/socket_test.go:538:21                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/common/socket/splitters.go:71:15                                    gosec  G115: integer overflow conversion uint64 -> int
plugins/common/socket/splitters.go:83:15                                    gosec  G115: integer overflow conversion uint64 -> int
plugins/common/socket/stream.go:88:29                                       gosec  G115: integer overflow conversion uint64 -> uint32
plugins/common/socket/stream.go:122:39                                      gosec  G115: integer overflow conversion uint64 -> uint32
plugins/common/yangmodel/decoder.go:182:14                                  gosec  G115: integer overflow conversion int64 -> int8
plugins/common/yangmodel/decoder.go:188:15                                  gosec  G115: integer overflow conversion int64 -> int16
plugins/common/yangmodel/decoder.go:194:15                                  gosec  G115: integer overflow conversion int64 -> int32
plugins/common/yangmodel/decoder.go:206:15                                  gosec  G115: integer overflow conversion uint64 -> uint8
plugins/common/yangmodel/decoder.go:212:16                                  gosec  G115: integer overflow conversion uint64 -> uint16
plugins/common/yangmodel/decoder.go:218:16                                  gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/apcupsd/apcupsd_test.go:189:41                               gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/chrony/chrony.go:67:41                                       gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/chrony/chrony_test.go:859:16                                 gosec  G115: integer overflow conversion int64 -> uint32
plugins/inputs/chrony/chrony_test.go:860:49                                 gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/chrony/chrony_test.go:861:49                                 gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/chrony/chrony_test.go:910:49                                 gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/chrony/chrony_test.go:1094:15                                gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go:292:23            gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go:378:31            gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt.go:378:53            gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt_test.go:973:21       gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt_test.go:984:21       gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_mdt_test.go:997:21       gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_util.go:37:15            gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/cisco_telemetry_mdt/cisco_telemetry_util.go:160:16           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/diskio/diskio_test.go:125:34                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/inputs/hddtemp/go-hddtemp/hddtemp.go:62:22                          gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/http_listener_v2/http_listener_v2_test.go:518:38             gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/influxdb_listener/influxdb_listener_test.go:632:38           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/influxdb_v2_listener/influxdb_v2_listener_test.go:472:38     gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/intel_pmt/intel_pmt.go:275:19                                gosec  G115: integer overflow conversion uint64 -> int
plugins/inputs/intel_pmu/config.go:195:33                                   gosec  G115: integer overflow conversion uint -> int
plugins/inputs/jti_openconfig_telemetry/jti_openconfig_telemetry.go:202:25  gosec  G115: integer overflow conversion int64 -> uint32
plugins/inputs/jti_openconfig_telemetry/jti_openconfig_telemetry.go:215:26  gosec  G115: integer overflow conversion int64 -> uint32
plugins/inputs/jti_openconfig_telemetry/jti_openconfig_telemetry.go:329:41  gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/kafka_consumer/kafka_consumer.go:166:37                      gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/lanz/lanz.go:99:29                                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/lanz/lanz.go:101:29                                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/lanz/lanz.go:121:24                                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/libvirt/libvirt_utils.go:74:83                               gosec  G115: integer overflow conversion int -> int32
plugins/inputs/libvirt/libvirt_utils.go:81:83                               gosec  G115: integer overflow conversion int -> int32
plugins/inputs/modbus/configuration_metric_test.go:178:20                   gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register.go:149:22                      gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:957:31                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:970:31                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:983:31                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1042:31                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1102:30                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1106:61                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1117:30                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1121:61                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1176:31                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_register_test.go:1179:61                gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_request_test.go:1032:22                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/configuration_request_test.go:1644:22                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/modbus_test.go:196:50                                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/modbus_test.go:669:20                                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/modbus/type_conversions16.go:32:16                           gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:36:22                           gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:40:23                           gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:44:24                           gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:111:15                          gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:116:15                          gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:121:15                          gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions16.go:126:15                          gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/modbus/type_conversions32.go:45:16                           gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:49:22                           gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:53:23                           gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:57:24                           gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:124:15                          gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:129:15                          gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:134:15                          gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions32.go:139:15                          gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/modbus/type_conversions64.go:47:16                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:51:15                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:56:15                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:73:16                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:114:15                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:119:15                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:124:15                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions64.go:129:15                          gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/modbus/type_conversions_bit.go:12:15                         gosec  G115: integer overflow conversion uint16 -> uint8
plugins/inputs/netflow/sflow_v5.go:235:55                                   gosec  G115: integer overflow conversion uint32 -> uint16
plugins/inputs/netflow/sflow_v5.go:239:41                                   gosec  G115: integer overflow conversion uint32 -> uint8
plugins/inputs/netflow/sflow_v5.go:258:41                                   gosec  G115: integer overflow conversion uint32 -> uint8
plugins/inputs/netflow/type_conversion.go:54:23                             gosec  G115: integer overflow conversion uint64 -> uint8
plugins/inputs/netflow/type_conversion.go:93:21                             gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/netflow/type_conversion.go:95:21                             gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/netflow/type_conversion.go:97:15                             gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/nsq_consumer/nsq_consumer_test.go:182:18                     gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/nsq_consumer/nsq_consumer_test.go:232:16                     gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/opcua_listener/subscribe_client.go:111:93                    gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/opentelemetry/grpc_service_profile.go:126:68                 gosec  G115: integer overflow conversion uint64 -> int64
plugins/inputs/p4runtime/p4runtime_test.go:370:12                           gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/phpfpm/fcgi.go:93:26                                         gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/phpfpm/fcgi.go:94:25                                         gosec  G115: integer overflow conversion int -> uint8
plugins/inputs/phpfpm/fcgi.go:162:38                                        gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/phpfpm/fcgi.go:171:28                                        gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/phpfpm/fcgi.go:172:32                                        gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/phpfpm/fcgi.go:203:18                                        gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/powerdns_recursor/powerdns_recursor.go:42:18                 gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/powerdns_recursor/protocol_commons.go:57:52                  gosec  G115: integer overflow conversion uint -> uint32
plugins/inputs/procstat/native_finder.go:48:25                              gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/native_finder_test.go:47:33                         gosec  G115: integer overflow conversion int -> int32
plugins/inputs/procstat/native_finder_test.go:52:33                         gosec  G115: integer overflow conversion int -> int32
plugins/inputs/procstat/os_linux.go:71:37                                   gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/procstat/os_linux.go:183:15                                  gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/procstat/os_linux.go:375:36                                  gosec  G115: integer overflow conversion uint32 -> uint8
plugins/inputs/procstat/pgrep.go:37:25                                      gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/pgrep.go:82:26                                      gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/procstat.go:494:37                                  gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/procstat.go:602:26                                  gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/procstat.go:656:26                                  gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/procstat.go:678:25                                  gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/procstat/procstat_test.go:364:12                             gosec  G115: integer overflow conversion int -> int32
plugins/inputs/procstat/procstat_test.go:512:12                             gosec  G115: integer overflow conversion int -> int32
plugins/inputs/procstat/procstat_test.go:533:12                             gosec  G115: integer overflow conversion int -> int32
plugins/inputs/procstat/service_finders.go:39:37                            gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/service_finders.go:89:39                            gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/procstat/service_finders.go:144:38                           gosec  G115: integer overflow conversion int64 -> int32
plugins/inputs/riemann_listener/riemann_listener.go:238:51                  gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/riemann_listener/riemann_listener.go:261:51                  gosec  G115: integer overflow conversion int -> uint32
plugins/inputs/s7comm/s7comm_test.go:940:52                                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/s7comm/s7comm_test.go:954:52                                 gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/s7comm/type_conversions.go:45:16                             gosec  G115: integer overflow conversion uint16 -> int16
plugins/inputs/s7comm/type_conversions.go:53:16                             gosec  G115: integer overflow conversion uint32 -> int32
plugins/inputs/sflow/packetdecoder.go:356:17                                gosec  G115: integer overflow conversion uint16 -> uint8
plugins/inputs/sflow/packetdecoder.go:394:16                                gosec  G115: integer overflow conversion uint32 -> uint8
plugins/inputs/sflow/packetdecoder.go:395:15                                gosec  G115: integer overflow conversion uint32 -> uint8
plugins/inputs/sflow/packetdecoder.go:447:27                                gosec  G115: integer overflow conversion uint16 -> uint8
plugins/inputs/snmp/snmp_test.go:456:20                                     gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/snmp/snmp_test.go:509:20                                     gosec  G115: integer overflow conversion int -> uint16
plugins/inputs/stackdriver/stackdriver.go:638:14                            gosec  G115: integer overflow conversion int -> int32
plugins/inputs/stackdriver/stackdriver.go:706:15                            gosec  G115: integer overflow conversion int -> int32
plugins/inputs/synproxy/synproxy_linux.go:86:58                             gosec  G115: integer overflow conversion uint64 -> uint32
plugins/inputs/syslog/syslog_test.go:147:13                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/inputs/syslog/syslog_test.go:269:15                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/application_insights/application_insights.go:297:13         gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/cloudwatch/cloudwatch.go:87:38                              gosec  G115: integer overflow conversion int64 -> int32
plugins/outputs/cloudwatch/cloudwatch.go:152:38                             gosec  G115: integer overflow conversion int64 -> int32
plugins/outputs/cratedb/cratedb.go:154:34                                   gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/cratedb/cratedb.go:246:14                                   gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/dynatrace/dynatrace.go:241:50                               gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/dynatrace/dynatrace.go:252:42                               gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/graphite/graphite.go:129:15                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/graylog/graylog.go:209:52                                   gosec  G115: integer overflow conversion int -> int8
plugins/outputs/influxdb/influxdb.go:119:20                                 gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/influxdb_v2/influxdb_v2.go:107:15                           gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/iotdb/iotdb.go:170:31                                       gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/iotdb/iotdb.go:174:30                                       gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/postgresql/datatype_uint8.go:193:11                         gosec  G115: integer overflow conversion uint64 -> int
plugins/outputs/postgresql/datatype_uint8.go:195:12                         gosec  G115: integer overflow conversion uint64 -> int8
plugins/outputs/postgresql/datatype_uint8.go:197:13                         gosec  G115: integer overflow conversion uint64 -> int16
plugins/outputs/postgresql/datatype_uint8.go:199:13                         gosec  G115: integer overflow conversion uint64 -> int32
plugins/outputs/postgresql/datatype_uint8.go:201:13                         gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/postgresql/datatype_uint8.go:205:13                         gosec  G115: integer overflow conversion uint64 -> uint8
plugins/outputs/postgresql/datatype_uint8.go:207:14                         gosec  G115: integer overflow conversion uint64 -> uint16
plugins/outputs/postgresql/datatype_uint8.go:209:14                         gosec  G115: integer overflow conversion uint64 -> uint32
plugins/outputs/postgresql/datatype_uint8.go:307:15                         gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/postgresql/postgresql_test.go:921:32                        gosec  G115: integer overflow conversion int -> int32
plugins/outputs/postgresql/table_source.go:90:21                            gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/postgresql/utils/utils.go:81:14                             gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/prometheus_client/prometheus_client.go:209:28               gosec  G115: integer overflow conversion uint64 -> uint32
plugins/outputs/socket_writer/socket_writer.go:87:29                        gosec  G115: integer overflow conversion uint64 -> uint32
plugins/outputs/socket_writer/socket_writer.go:87:42                        gosec  G115: integer overflow conversion uint64 -> uint32
plugins/outputs/stackdriver/stackdriver.go:535:23                           gosec  G115: integer overflow conversion uint64 -> int64
plugins/outputs/sumologic/sumologic_test.go:609:40                          gosec  G115: integer overflow conversion int -> int32
plugins/outputs/syslog/syslog_mapper.go:95:25                               gosec  G115: integer overflow conversion uint64 -> uint16
plugins/outputs/syslog/syslog_mapper.go:184:14                              gosec  G115: integer overflow conversion uint64 -> uint8
plugins/outputs/warp10/warp10.go:183:34                                     gosec  G115: integer overflow conversion uint64 -> int64
plugins/parsers/binary/entry.go:282:15                                      gosec  G115: integer overflow conversion uint16 -> int16
plugins/parsers/binary/entry.go:287:15                                      gosec  G115: integer overflow conversion uint32 -> int32
plugins/parsers/binary/entry.go:292:15                                      gosec  G115: integer overflow conversion uint64 -> int64
plugins/processors/aws_ec2/ec2_test.go:169:13                               gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/execd/execd_test.go:380:13                               gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/ifname/ifname_test.go:203:13                             gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/snmp_lookup/lookup_test.go:367:15                        gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/snmp_lookup/lookup_test.go:457:13                        gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/snmp_lookup/lookup_test.go:484:13                        gosec  G115: integer overflow conversion uint64 -> int
plugins/processors/snmp_lookup/lookup_test.go:628:13                        gosec  G115: integer overflow conversion uint64 -> int
plugins/serializers/binary/type_conversions.go:20:20                        gosec  G115: integer overflow conversion uint64 -> int
plugins/serializers/binary/type_conversions.go:21:20                        gosec  G115: integer overflow conversion uint64 -> int
plugins/serializers/binary/type_conversions.go:24:28                        gosec  G115: integer overflow conversion uint64 -> int
plugins/serializers/influx/influx.go:282:36                                 gosec  G115: integer overflow conversion uint64 -> int64
plugins/serializers/msgpack/metric.go:64:41                                 gosec  G115: integer overflow conversion int64 -> uint32
plugins/serializers/msgpack/metric.go:75:41                                 gosec  G115: integer overflow conversion int -> uint32
plugins/serializers/msgpack/metric.go:95:27                                 gosec  G115: integer overflow conversion uint64 -> int64
plugins/serializers/msgpack/metric.go:95:39                                 gosec  G115: integer overflow conversion uint64 -> int64
plugins/serializers/msgpack/metric.go:100:27                                gosec  G115: integer overflow conversion uint64 -> int64
testutil/accumulator.go:362:9                                               gosec  G115: integer overflow conversion uint64 -> int

Additional info

For this rule no additional configuration can be provided.

@zak-pawel
Copy link
Collaborator Author

A valuable rule, but after a quick review of the findings, it seems that there might be a lot of false positives (more info: here).

@srebhan
Copy link
Member

srebhan commented Sep 2, 2024

While I would love to get a check on those, the number of false-positives worries me! I'd say we revisit this checker in a few versions and see if they honor bound checks... What do you think?

@zak-pawel
Copy link
Collaborator Author

@srebhan Makes perfect sense

@srebhan
Copy link
Member

srebhan commented Sep 2, 2024

Should we close the issue then as "not planned" and you keep it on your list @zak-pawel?

@zak-pawel
Copy link
Collaborator Author

Let's do as you suggest.

@zak-pawel zak-pawel closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants