mariadb/tests/code_quality/cppcheck_ignorelist.txt
Anson Chung df35072c8d Refactor GitLab cppcheck and update SAST ignorelists
Line numbers had to be removed from the ignorelists in order to be
diffed against since locations of the same findings can differ
across runs. Therefore preprocessing has to be done on the CI findings
so that it can be compared to the ignorelist and new findings can be
outputted. However, since line numbers have to be removed, a situation
occurs where it is difficult to reference the location of findings
in code given the output of the CI job.

To lessen this pain, change the cppcheck template to include
code snippets which make it easier to reference where in the code
the finding is referring to, even in the absence of line numbers.
Ignorelisting works as before since locations of the finding may
change but not the code it is referring to.

Furthermore, due to the innate difficulty in maintaining ignorelists
across branches and triaging new findings, allow failure as to not
have constantly failing pipelines as a result of a new findings that
have not been addressed yet.

Lastly, update SAST ignorelists to match the newly refactored cppcheck
job and the current state of the codebase.

All new code of the whole pull request, including one or several
files that are either new files or modified ones, are contributed
under the BSD-new license. I am contributing on behalf of my
employer Amazon Web Services, Inc.
2024-07-08 10:51:48 +01:00

85 lines
9.6 KiB
Text

client/mysqlbinlog.cc ev->output_buf.copy(e->output_buf); warning: Possible null pointer dereference: e
client/mysqldump.c return buff; warning: Uninitialized variable: buff
client/mysqldump.c return buff; warning: Uninitialized variable: buff
include/my_global.h #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS" error: #error "please add -DSTACK_DIRECTION=1 or -1 to your CPPFLAGS"
include/my_global.h #error WHAT? sizeof(long long) < 8 ??? error: #error WHAT? sizeof(long long) < 8 ???
include/mysql/psi/mysql_socket.h result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags); error: syntax error
include/mysql/psi/mysql_socket.h result= send(mysql_socket.fd, buf, IF_WIN((int),) n, flags); error: syntax error
include/mysql/psi/psi.h #error "You must include my_global.h in the code for the build to be correct." error: #error "You must include my_global.h in the code for the build to be correct."
mysql-test/lib/My/SafeProcess/safe_process_win.cc |FORMAT_MESSAGE_IGNORE_INSERTS, NULL, last_err , 0, (LPSTR)&message_text, error: Uninitialized variable: message_text
mysys/file_logger.c *l_perm= new_log; error: Uninitialized struct member: new_log.lock
mysys/ma_dyncol.c float8get(store_it_here->x.double_value, data); error: Uninitialized variable: def_temp
mysys/mf_loadpath.c strmake(to, from, FN_REFLEN-1); warning: Uninitialized variable: from
mysys/my_compare.c mi_float4get(f_1,a); error: Uninitialized variable: def_temp
mysys/my_compare.c mi_float4get(f_2,b); error: Uninitialized variable: def_temp
mysys/my_compare.c mi_float8get(d_1,a); error: Uninitialized variable: def_temp
mysys/my_compare.c mi_float8get(d_2,b); error: Uninitialized variable: def_temp
mysys/my_symlink2.c create_link= (linkname && strcmp(abs_linkname,filename)); error: Uninitialized variable: abs_linkname
plugin/sql_errlog/sql_errlog.c (void) localtime_r(&event_time, &t); error: Uninitialized variable: &t
sql-common/client_plugin.c bzero(&unused, sizeof unused); error: va_list 'unused' used before va_start() was called.
sql-common/client_plugin.c plugin= add_plugin(mysql, plugin, 0, 0, unused); error: va_list 'unused' used before va_start() was called.
sql/gen_lex_hash.cc hash_map= (char*)realloc((char*)hash_map,size_hash_map); error: Common realloc mistake: 'hash_map' nulled but not freed upon failure
sql/my_apc.cc apc_calls->prev= qe; error: Non-local variable 'apc_calls->prev' will use pointer to local variable 'apc_request'.
sql/my_apc.cc apc_calls= qe; error: Non-local variable 'apc_calls' will use pointer to local variable 'apc_request'.
sql/sql_string.cc memcpy(dots, STRING_WITH_LEN("...\0")); error: failed to expand 'memcpy', Wrong number of parameters for macro 'memcpy'.
storage/cassandra/gen-cpp/Cassandra_server.skeleton.cpp printf("get_count\n"); error: Found an exit path from function with non-void return type that has missing return statement
storage/connect/connect.cc rcb= valp->SetValue_char(kp, (int)lg); error: Uninitialized variable: lg
storage/connect/connect.cc rcb= valp->SetValue_char((char*)p, (int)lg); error: Uninitialized variable: lg
storage/connect/macutil.cpp #error This is WINDOWS only DLL error: #error This is WINDOWS only DLL
storage/connect/tabjson.cpp Val->SetValue(jsp); warning: Possible null pointer dereference: Val
storage/connect/tabmac.cpp #error This is a WINDOWS only table type error: #error This is a WINDOWS only table type
storage/connect/taboccur.cpp for (i = 0, pcrp = &qrp->Colresp; (crp = *pcrp); ) { warning: Uninitialized variable: *pcrp
storage/connect/tabwmi.cpp #error This is a WINDOWS only table type error: #error This is a WINDOWS only table type
storage/connect/unzip.c us.z_filefunc = *pzlib_filefunc64_32_def; warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file
storage/connect/value.cpp if ((t -= (n * FOURYEARS)) > 2000000000) error: Signed integer overflow for expression 'n*126230400'.
storage/connect/zip.c ziinit.z_filefunc = *pzlib_filefunc64_32_def; warning: Uninitialized variable: *pzlib_filefunc64_32_def.zopen32_file
storage/federated/ha_federated.cc DBUG_RETURN(retval); error: Uninitialized variable: retval
storage/federatedx/federatedx_pushdown.cc ha_federatedx *h= (ha_federatedx *) table->file; warning: Possible null pointer dereference: table
storage/federatedx/federatedx_pushdown.cc share= get_share(table->s->table_name.str, table); warning: Possible null pointer dereference: table
storage/heap/hp_hash.c float4get(nr, pos); error: Uninitialized variable: def_temp
storage/heap/hp_hash.c float8get(nr, pos); error: Uninitialized variable: def_temp
storage/heap/hp_hash.c float4get(f_1,key); error: Uninitialized variable: def_temp
storage/heap/hp_hash.c float8get(f_1,key); error: Uninitialized variable: def_temp
storage/maria/ma_create.c DBUG_RETURN(my_pwrite(file, buf, sizeof(buf), error: Uninitialized variable: trid_buff
storage/maria/ma_dbug.c mi_float4get(f_1,key); error: Uninitialized variable: def_temp
storage/maria/ma_dbug.c mi_float8get(d_1,key); error: Uninitialized variable: def_temp
storage/maria/ma_ft_parser.c param->mysql_ftparam= &my_param; error: Address of local auto-variable assigned to a function parameter.
storage/maria/ma_key.c float4get(nr,pos); error: Uninitialized variable: def_temp
storage/maria/ma_key.c float8get(nr,pos); error: Uninitialized variable: def_temp
storage/maria/ma_key.c float4get(f_1,key); error: Uninitialized variable: def_temp
storage/maria/ma_key.c float8get(f_1,key); error: Uninitialized variable: def_temp
storage/maria/ma_locking.c write_error= (int) my_pwrite(share->kfile.file, buff, sizeof(buff), error: Uninitialized variable: buff
storage/maria/ma_locking.c (void) my_pwrite(share->kfile.file, buff, sizeof(buff), error: Uninitialized variable: buff
storage/maria/ma_loghandler.c if (! --fc_ptr->counter) warning: Uninitialized variable: fc_ptr
storage/maria/ma_loghandler.c (offset < data->current_offset && warning: Uninitialized variable: data->current_offset
storage/maria/ma_open.c float8get(state->rec_per_key_part[i], ptr); ptr+= 8; error: Uninitialized variable: def_temp
storage/maria/ma_open.c return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; error: Uninitialized variable: buff
storage/maria/ma_open.c return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; error: Uninitialized variable: buff
storage/maria/ma_recovery_util.c va_start(args, format); error: va_start() or va_copy() called subsequently on 'args' without va_end() in between.
storage/maria/ma_search.c if (flag == 0) warning: Uninitialized variable: flag
storage/maria/ma_write.c key->data= key_buff; error: Address of local auto-variable assigned to a function parameter.
storage/maria/tablockman.c mysql_mutex_init(& lm->pool_mutex, MY_MUTEX_INIT_FAST); error: failed to expand 'mysql_mutex_init', Wrong number of parameters for macro 'mysql_mutex_init'.
storage/myisam/ft_parser.c param->mysql_ftparam= &my_param; error: Address of local auto-variable assigned to a function parameter.
storage/myisam/mi_dbug.c mi_float4get(f_1,key); error: Uninitialized variable: def_temp
storage/myisam/mi_dbug.c mi_float8get(d_1,key); error: Uninitialized variable: def_temp
storage/myisam/mi_key.c float4get(nr,pos); error: Uninitialized variable: def_temp
storage/myisam/mi_key.c float8get(nr,pos); error: Uninitialized variable: def_temp
storage/myisam/mi_key.c float4get(f_1,key); error: Uninitialized variable: def_temp
storage/myisam/mi_key.c float8get(f_1,key); error: Uninitialized variable: def_temp
storage/myisam/mi_locking.c write_error= (mysql_file_pwrite(share->kfile, buff, sizeof(buff), error: Uninitialized variable: buff
storage/myisam/mi_open.c return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; error: Uninitialized variable: buff
storage/myisam/mi_open.c return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; error: Uninitialized variable: buff
storage/myisam/mi_open.c return mysql_file_write(file, buff, (size_t) (ptr-buff), MYF(MY_NABP)) != 0; error: Uninitialized variable: buff
storage/myisam/mi_search.c if (flag == 0) warning: Uninitialized variable: flag
storage/perfschema/pfs_global.cc return NULL; error: Memory leak: ptr
storage/sequence/sequence.cc maria_declare_plugin(sequence) error: syntax error
strings/decimal.c sanity(to); warning: Possible null pointer dereference: to
strings/dump_map.c if (fromstat[i]) error: Array 'fromstat[256]' accessed at index 256, which is out of bounds.
unittest/mytap/tap.c memset(&ap, 0, sizeof(ap)); error: va_list 'ap' used before va_start() was called.
unittest/mytap/tap.c vemit_tap(pass, NULL, ap); error: va_list 'ap' used before va_start() was called.
unittest/mytap/tap.c memset((char*) &ap, 0, sizeof(ap)); /* Keep compiler happy */ error: va_list 'ap' used before va_start() was called.
unittest/mytap/tap.c vemit_tap(1, NULL, ap); error: va_list 'ap' used before va_start() was called.
vio/viotest-sslconnect.cc delete vio; error: Memory pointed to by 'vio' is freed twice.
vio/viotest-sslconnect.cc delete ssl_connector; error: Memory pointed to by 'ssl_connector' is freed twice.
wsrep-lib/src/server_state.cpp try error: syntax error: keyword 'try' is not allowed in global scope
wsrep-lib/src/thread_service_v1.cpp throw; // Implementation broke the contract and returned. error: Rethrowing current exception with 'throw;', it seems there is no current exception to rethrow. If there is no current exception this calls std::terminate(). More: https://isocpp.org/wiki/faq/exceptions#throw-without-an-object