Error: COMPILER_WARNING (CWE-477): [#def1] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c: scope_hint: In function ‘close_location’ libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:156:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:22: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 154| if (loc->is_ssh) { # 155| if (loc->scp) { # 156|-> rc = ssh_scp_close(loc->scp); # 157| if (rc == SSH_ERROR) { # 158| fprintf(stderr, Error: COMPILER_WARNING (CWE-477): [#def2] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:162:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 160| ssh_get_error(loc->session)); # 161| } # 162|-> ssh_scp_free(loc->scp); # 163| loc->scp = NULL; # 164| } Error: COMPILER_WARNING (CWE-477): [#def3] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c: scope_hint: In function ‘open_location’ libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:187:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 185| } # 186| # 187|-> loc->scp = ssh_scp_new(loc->session, SSH_SCP_WRITE, loc->path); # 188| if (!loc->scp) { # 189| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); Error: COMPILER_WARNING (CWE-477): [#def4] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:196:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 194| } # 195| # 196|-> if (ssh_scp_init(loc->scp) == SSH_ERROR) { # 197| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); # 198| ssh_scp_free(loc->scp); Error: COMPILER_WARNING (CWE-477): [#def5] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:198:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 196| if (ssh_scp_init(loc->scp) == SSH_ERROR) { # 197| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); # 198|-> ssh_scp_free(loc->scp); # 199| loc->scp = NULL; # 200| ssh_disconnect(loc->session); Error: COMPILER_WARNING (CWE-477): [#def6] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:213:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 211| } # 212| # 213|-> loc->scp = ssh_scp_new(loc->session, SSH_SCP_READ, loc->path); # 214| if (!loc->scp) { # 215| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); Error: COMPILER_WARNING (CWE-477): [#def7] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:222:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 220| } # 221| # 222|-> if (ssh_scp_init(loc->scp) == SSH_ERROR) { # 223| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); # 224| ssh_scp_free(loc->scp); Error: COMPILER_WARNING (CWE-477): [#def8] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:224:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 222| if (ssh_scp_init(loc->scp) == SSH_ERROR) { # 223| fprintf(stderr, "error : %s\n", ssh_get_error(loc->session)); # 224|-> ssh_scp_free(loc->scp); # 225| loc->scp = NULL; # 226| ssh_disconnect(loc->session); Error: GCC_ANALYZER_WARNING (CWE-688): [#def9] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:273:14: warning[-Wanalyzer-null-argument]: use of NULL ‘*src.file’ where non-null expected libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:19: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:16: included_from: Included from here. /usr/include/stdio.h:873:12: note: argument 1 of ‘fileno’ must be non-null # 271| /* Get the file name and size*/ # 272| if (!src->is_ssh) { # 273|-> fd = fileno(src->file); # 274| if (fd < 0) { # 275| fprintf(stderr, Error: COMPILER_WARNING (CWE-477): [#def10] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c: scope_hint: In function ‘do_copy’ libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:290:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 288| size = 0; # 289| do { # 290|-> r = ssh_scp_pull_request(src->scp); # 291| if (r == SSH_SCP_REQUEST_NEWDIR) { # 292| ssh_scp_deny_request(src->scp, "Not in recursive mode"); Error: COMPILER_WARNING (CWE-477): [#def11] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:292:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_deny_request’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:589:31: note: declared here # 290| r = ssh_scp_pull_request(src->scp); # 291| if (r == SSH_SCP_REQUEST_NEWDIR) { # 292|-> ssh_scp_deny_request(src->scp, "Not in recursive mode"); # 293| continue; # 294| } Error: COMPILER_WARNING (CWE-477): [#def12] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:296:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:601:34: note: declared here # 294| } # 295| if (r == SSH_SCP_REQUEST_NEWFILE) { # 296|-> size = ssh_scp_request_get_size(src->scp); # 297| filename = strdup(ssh_scp_request_get_filename(src->scp)); # 298| mode = ssh_scp_request_get_permissions(src->scp); Error: COMPILER_WARNING (CWE-477): [#def13] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:297:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 295| if (r == SSH_SCP_REQUEST_NEWFILE) { # 296| size = ssh_scp_request_get_size(src->scp); # 297|-> filename = strdup(ssh_scp_request_get_filename(src->scp)); # 298| mode = ssh_scp_request_get_permissions(src->scp); # 299| //ssh_scp_accept_request(src->scp); Error: COMPILER_WARNING (CWE-477): [#def14] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:298:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 296| size = ssh_scp_request_get_size(src->scp); # 297| filename = strdup(ssh_scp_request_get_filename(src->scp)); # 298|-> mode = ssh_scp_request_get_permissions(src->scp); # 299| //ssh_scp_accept_request(src->scp); # 300| break; Error: COMPILER_WARNING (CWE-477): [#def15] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:313:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:596:31: note: declared here # 311| # 312| if (dest->is_ssh) { # 313|-> r = ssh_scp_push_file(dest->scp, src->path, size, mode); # 314| // snprintf(buffer, sizeof(buffer), "C0644 %d %s\n", size, src->path); # 315| if (r == SSH_ERROR) { Error: COMPILER_WARNING (CWE-477): [#def16] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:320:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 318| ssh_get_error(dest->session)); # 319| SSH_STRING_FREE_CHAR(filename); # 320|-> ssh_scp_free(dest->scp); # 321| dest->scp = NULL; # 322| return -1; Error: COMPILER_WARNING (CWE-477): [#def17] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:332:21: warning[-Wdeprecated-declarations]: ‘ssh_scp_deny_request’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:589:31: note: declared here # 330| filename, strerror(errno)); # 331| if (src->is_ssh) { # 332|-> ssh_scp_deny_request(src->scp, "Cannot open local file"); # 333| } # 334| SSH_STRING_FREE_CHAR(filename); Error: COMPILER_WARNING (CWE-477): [#def18] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:339:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 337| } # 338| if (src->is_ssh) { # 339|-> ssh_scp_accept_request(src->scp); # 340| } # 341| } Error: COMPILER_WARNING (CWE-477): [#def19] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:345:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:598:31: note: declared here # 343| do { # 344| if (src->is_ssh) { # 345|-> r = ssh_scp_read(src->scp, buffer, sizeof(buffer)); # 346| if (r == SSH_ERROR) { # 347| fprintf(stderr, Error: COMPILER_WARNING (CWE-477): [#def20] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:373:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:604:31: note: declared here # 371| # 372| if (dest->is_ssh) { # 373|-> w = ssh_scp_write(dest->scp, buffer, r); # 374| if (w == SSH_ERROR) { # 375| fprintf(stderr, Error: COMPILER_WARNING (CWE-477): [#def21] libssh-0.11.1-build/libssh-0.11.1/examples/libssh_scp.c:378:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 376| "Error writing in scp: %s\n", # 377| ssh_get_error(dest->session)); # 378|-> ssh_scp_free(dest->scp); # 379| dest->scp = NULL; # 380| SSH_STRING_FREE_CHAR(filename); Error: COMPILER_WARNING (CWE-477): [#def22] libssh-0.11.1-build/libssh-0.11.1/examples/samplesshd-kbdint.c: scope_hint: In function ‘authenticate’ libssh-0.11.1-build/libssh-0.11.1/examples/samplesshd-kbdint.c:227:32: warning[-Wdeprecated-declarations]: ‘ssh_message_auth_password’ is deprecated # 227 | ssh_message_auth_password(message)); # | ^~~~~~~~~~~~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/examples/samplesshd-kbdint.c:18: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/server.h:306:39: note: declared here # 306 | SSH_DEPRECATED LIBSSH_API const char *ssh_message_auth_password(ssh_message msg); # | ^~~~~~~~~~~~~~~~~~~~~~~~~ # 225| printf("User %s wants to auth with pass %s\n", # 226| ssh_message_auth_user(message), # 227|-> ssh_message_auth_password(message)); # 228| if(auth_password(ssh_message_auth_user(message), # 229| ssh_message_auth_password(message))){ Error: COMPILER_WARNING (CWE-477): [#def23] libssh-0.11.1-build/libssh-0.11.1/examples/samplesshd-kbdint.c:229:28: warning[-Wdeprecated-declarations]: ‘ssh_message_auth_password’ is deprecated # 229 | ssh_message_auth_password(message))){ # | ^~~~~~~~~~~~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/server.h:306:39: note: declared here # 306 | SSH_DEPRECATED LIBSSH_API const char *ssh_message_auth_password(ssh_message msg); # | ^~~~~~~~~~~~~~~~~~~~~~~~~ # 227| ssh_message_auth_password(message)); # 228| if(auth_password(ssh_message_auth_user(message), # 229|-> ssh_message_auth_password(message))){ # 230| ssh_message_auth_reply_success(message,0); # 231| ssh_message_free(message); Error: COMPILER_WARNING (CWE-477): [#def24] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c: scope_hint: In function ‘fetch_files’ libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:113:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 113 | ssh_scp scp=ssh_scp_new(session, SSH_SCP_READ | SSH_SCP_RECURSIVE, "/tmp/libssh_tests/*"); # | ^~~~~~~ libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:22: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 111| char *filename; # 112| int r; # 113|-> ssh_scp scp=ssh_scp_new(session, SSH_SCP_READ | SSH_SCP_RECURSIVE, "/tmp/libssh_tests/*"); # 114| if(ssh_scp_init(scp) != SSH_OK){ # 115| fprintf(stderr,"error initializing scp: %s\n",ssh_get_error(session)); Error: COMPILER_WARNING (CWE-477): [#def25] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:114:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 114 | if(ssh_scp_init(scp) != SSH_OK){ # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 112| int r; # 113| ssh_scp scp=ssh_scp_new(session, SSH_SCP_READ | SSH_SCP_RECURSIVE, "/tmp/libssh_tests/*"); # 114|-> if(ssh_scp_init(scp) != SSH_OK){ # 115| fprintf(stderr,"error initializing scp: %s\n",ssh_get_error(session)); # 116| ssh_scp_free(scp); Error: COMPILER_WARNING (CWE-477): [#def26] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:116:11: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 116 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 114| if(ssh_scp_init(scp) != SSH_OK){ # 115| fprintf(stderr,"error initializing scp: %s\n",ssh_get_error(session)); # 116|-> ssh_scp_free(scp); # 117| return -1; # 118| } Error: COMPILER_WARNING (CWE-477): [#def27] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:122:11: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 122 | r=ssh_scp_pull_request(scp); # | ^ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 120| do { # 121| # 122|-> r=ssh_scp_pull_request(scp); # 123| switch(r){ # 124| case SSH_SCP_REQUEST_NEWFILE: Error: COMPILER_WARNING (CWE-477): [#def28] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:125:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated # 125 | size=ssh_scp_request_get_size(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:601:34: note: declared here # 601 | SSH_DEPRECATED LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~ # 123| switch(r){ # 124| case SSH_SCP_REQUEST_NEWFILE: # 125|-> size=ssh_scp_request_get_size(scp); # 126| filename=strdup(ssh_scp_request_get_filename(scp)); # 127| mode=ssh_scp_request_get_permissions(scp); Error: COMPILER_WARNING (CWE-477): [#def29] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:126:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated # 126 | filename=strdup(ssh_scp_request_get_filename(scp)); # | ^~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 599 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 124| case SSH_SCP_REQUEST_NEWFILE: # 125| size=ssh_scp_request_get_size(scp); # 126|-> filename=strdup(ssh_scp_request_get_filename(scp)); # 127| mode=ssh_scp_request_get_permissions(scp); # 128| printf("downloading file %s, size %d, perms 0%o\n",filename,size,mode); Error: COMPILER_WARNING (CWE-477): [#def30] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:127:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated # 127 | mode=ssh_scp_request_get_permissions(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 600 | SSH_DEPRECATED LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 125| size=ssh_scp_request_get_size(scp); # 126| filename=strdup(ssh_scp_request_get_filename(scp)); # 127|-> mode=ssh_scp_request_get_permissions(scp); # 128| printf("downloading file %s, size %d, perms 0%o\n",filename,size,mode); # 129| free(filename); Error: COMPILER_WARNING (CWE-477): [#def31] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:130:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 130 | ssh_scp_accept_request(scp); # | ^~~~~~~~~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 587 | SSH_DEPRECATED LIBSSH_API int ssh_scp_accept_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~ # 128| printf("downloading file %s, size %d, perms 0%o\n",filename,size,mode); # 129| free(filename); # 130|-> ssh_scp_accept_request(scp); # 131| r=ssh_scp_read(scp,buffer,sizeof(buffer)); # 132| if(r==SSH_ERROR){ Error: COMPILER_WARNING (CWE-477): [#def32] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:131:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated # 131 | r=ssh_scp_read(scp,buffer,sizeof(buffer)); # | ^ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:598:31: note: declared here # 598 | SSH_DEPRECATED LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size); # | ^~~~~~~~~~~~ # 129| free(filename); # 130| ssh_scp_accept_request(scp); # 131|-> r=ssh_scp_read(scp,buffer,sizeof(buffer)); # 132| if(r==SSH_ERROR){ # 133| fprintf(stderr,"Error reading scp: %s\n",ssh_get_error(session)); Error: COMPILER_WARNING (CWE-477): [#def33] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:134:27: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 134 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 132| if(r==SSH_ERROR){ # 133| fprintf(stderr,"Error reading scp: %s\n",ssh_get_error(session)); # 134|-> ssh_scp_close(scp); # 135| ssh_scp_free(scp); # 136| return -1; Error: COMPILER_WARNING (CWE-477): [#def34] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:135:27: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 135 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 133| fprintf(stderr,"Error reading scp: %s\n",ssh_get_error(session)); # 134| ssh_scp_close(scp); # 135|-> ssh_scp_free(scp); # 136| return -1; # 137| } Error: COMPILER_WARNING (CWE-477): [#def35] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:142:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 142 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 140| case SSH_ERROR: # 141| fprintf(stderr,"Error: %s\n",ssh_get_error(session)); # 142|-> ssh_scp_close(scp); # 143| ssh_scp_free(scp); # 144| return -1; Error: COMPILER_WARNING (CWE-477): [#def36] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:143:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 143 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 141| fprintf(stderr,"Error: %s\n",ssh_get_error(session)); # 142| ssh_scp_close(scp); # 143|-> ssh_scp_free(scp); # 144| return -1; # 145| case SSH_SCP_REQUEST_WARNING: Error: COMPILER_WARNING (CWE-477): [#def37] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:146:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_warning’ is deprecated # 146 | fprintf(stderr,"Warning: %s\n",ssh_scp_request_get_warning(scp)); # | ^~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:603:39: note: declared here # 603 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_warning(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 144| return -1; # 145| case SSH_SCP_REQUEST_WARNING: # 146|-> fprintf(stderr,"Warning: %s\n",ssh_scp_request_get_warning(scp)); # 147| break; # 148| case SSH_SCP_REQUEST_NEWDIR: Error: COMPILER_WARNING (CWE-477): [#def38] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:149:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated # 149 | filename=strdup(ssh_scp_request_get_filename(scp)); # | ^~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 599 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 147| break; # 148| case SSH_SCP_REQUEST_NEWDIR: # 149|-> filename=strdup(ssh_scp_request_get_filename(scp)); # 150| mode=ssh_scp_request_get_permissions(scp); # 151| printf("downloading directory %s, perms 0%o\n",filename,mode); Error: COMPILER_WARNING (CWE-477): [#def39] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:150:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated # 150 | mode=ssh_scp_request_get_permissions(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 600 | SSH_DEPRECATED LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 148| case SSH_SCP_REQUEST_NEWDIR: # 149| filename=strdup(ssh_scp_request_get_filename(scp)); # 150|-> mode=ssh_scp_request_get_permissions(scp); # 151| printf("downloading directory %s, perms 0%o\n",filename,mode); # 152| free(filename); Error: COMPILER_WARNING (CWE-477): [#def40] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:153:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 153 | ssh_scp_accept_request(scp); # | ^~~~~~~~~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 587 | SSH_DEPRECATED LIBSSH_API int ssh_scp_accept_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~ # 151| printf("downloading directory %s, perms 0%o\n",filename,mode); # 152| free(filename); # 153|-> ssh_scp_accept_request(scp); # 154| break; # 155| case SSH_SCP_REQUEST_ENDDIR: Error: COMPILER_WARNING (CWE-477): [#def41] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:164:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 164 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 162| } while (1); # 163| end: # 164|-> ssh_scp_close(scp); # 165| ssh_scp_free(scp); # 166| return 0; Error: COMPILER_WARNING (CWE-477): [#def42] libssh-0.11.1-build/libssh-0.11.1/examples/scp_download.c:165:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 165 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 163| end: # 164| ssh_scp_close(scp); # 165|-> ssh_scp_free(scp); # 166| return 0; # 167| } Error: CPPCHECK_WARNING (CWE-457): [#def43] libssh-0.11.1-build/libssh-0.11.1/examples/senddata.c:41: error[uninitvar]: Uninitialized variable: buffer # 39| # 40| # 41|-> while ((rc = ssh_channel_write(channel, buffer, sizeof(buffer))) > 0) { # 42| total += rc; # 43| if(total/2 >= lastshown){ Error: GCC_ANALYZER_WARNING (CWE-476): [#def44] libssh-0.11.1-build/libssh-0.11.1/examples/ssh_X11_client.c: scope_hint: In function ‘copy_fd_to_channel_callback’ libssh-0.11.1-build/libssh-0.11.1/examples/ssh_X11_client.c:601:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 599| if (channel == NULL) { # 600| _ssh_log(SSH_LOG_FUNCTIONS, __func__, "channel does not exist."); # 601|-> if (temp_node->protected == 0) { # 602| close(fd); # 603| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def45] libssh-0.11.1-build/libssh-0.11.1/examples/ssh_X11_client.c:626:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 624| _ssh_log(SSH_LOG_FUNCTIONS, __func__, # 625| "Why the hell am I here?: sz: %d", sz); # 626|-> if (temp_node->protected == 0) { # 627| close(fd); # 628| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def46] libssh-0.11.1-build/libssh-0.11.1/examples/ssh_X11_client.c: scope_hint: In function ‘copy_channel_to_fd_callback’ libssh-0.11.1-build/libssh-0.11.1/examples/ssh_X11_client.c:655:8: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 653| temp_node = search_item(channel); # 654| # 655|-> fd = temp_node->fd_out; # 656| # 657| _ssh_log(SSH_LOG_FUNCTIONS, __func__, "len: %d - fd: %d - is_stderr: %d", Error: GCC_ANALYZER_WARNING (CWE-479): [#def47] libssh-0.11.1-build/libssh-0.11.1/examples/ssh_client.c: scope_hint: In function ‘do_exit’ libssh-0.11.1-build/libssh-0.11.1/examples/ssh_client.c:174:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler libssh-0.11.1-build/libssh-0.11.1/examples/ssh_client.c:174:5: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’ # 172| # 173| do_cleanup(0); # 174|-> exit(0); # 175| } # 176| Error: GCC_ANALYZER_WARNING (CWE-465): [#def48] libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c: scope_hint: In function ‘do_cleanup’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:45:30: warning[-Wanalyzer-deref-before-check]: check of ‘*current.data’ for NULL after already dereferencing it libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:139:17: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:137:17: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:137:17: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:138:17: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:45:32: note: in definition of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/examples/sshd_direct-tcpip.c:139:17: note: in expansion of macro ‘SAFE_FREE’ # 43| #endif # 44| # 45|-> #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) # 46| # 47| #ifndef __unused__ Error: GCC_ANALYZER_WARNING (CWE-401): [#def49] libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:843:29: warning[-Wanalyzer-malloc-leak]: leak of ‘h’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:526:9: note: in expansion of macro ‘SSH_STRING_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:54: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:517:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:526:9: note: in expansion of macro ‘SSH_STRING_FREE’ # 841| LIBSSH_API int ssh_string_fill(ssh_string str, const void *data, size_t len); # 842| #define SSH_STRING_FREE(x) \ # 843|-> do { if ((x) != NULL) { ssh_string_free(x); x = NULL; } } while(0) # 844| LIBSSH_API void ssh_string_free(ssh_string str); # 845| LIBSSH_API ssh_string ssh_string_from_char(const char *what); Error: GCC_ANALYZER_WARNING (CWE-401): [#def50] libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c: scope_hint: In function ‘ssh_packet_userauth_gssapi_response’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:843:29: warning[-Wanalyzer-malloc-leak]: leak of ‘ssh_gssapi_oid_from_string(ssh_buffer_get_ssh_string(packet))’ libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c:860:5: note: in expansion of macro ‘SSH_STRING_FREE’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/callbacks.h:561:13: note: in definition of macro ‘SSH_PACKET_CALLBACK’ libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c:860:5: note: in expansion of macro ‘SSH_STRING_FREE’ # 841| LIBSSH_API int ssh_string_fill(ssh_string str, const void *data, size_t len); # 842| #define SSH_STRING_FREE(x) \ # 843|-> do { if ((x) != NULL) { ssh_string_free(x); x = NULL; } } while(0) # 844| LIBSSH_API void ssh_string_free(ssh_string str); # 845| LIBSSH_API ssh_string ssh_string_from_char(const char *what); Error: GCC_ANALYZER_WARNING (CWE-401): [#def51] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:49: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_opendir’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:881:29: warning[-Wanalyzer-malloc-leak]: leak of ‘h’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:513:9: note: in expansion of macro ‘SSH_BUFFER_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:513:9: note: in expansion of macro ‘SSH_BUFFER_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:513:9: note: in expansion of macro ‘SSH_BUFFER_FREE’ # 879| LIBSSH_API void ssh_buffer_free(ssh_buffer buffer); # 880| #define SSH_BUFFER_FREE(x) \ # 881|-> do { if ((x) != NULL) { ssh_buffer_free(x); x = NULL; } } while(0) # 882| LIBSSH_API int ssh_buffer_reinit(ssh_buffer buffer); # 883| LIBSSH_API int ssh_buffer_add_data(ssh_buffer buffer, const void *data, uint32_t len); Error: GCC_ANALYZER_WARNING (CWE-465): [#def52] libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:33: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/server/torture_sftpserver.c:34: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/server/torture_sftpserver.c: scope_hint: In function ‘session_teardown’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:353:30: warning[-Wanalyzer-deref-before-check]: check of ‘*s.ssh.tsftp’ for NULL after already dereferencing it libssh-0.11.1-build/libssh-0.11.1/tests/server/torture_sftpserver.c:342:5: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:353:32: note: in definition of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/tests/server/torture_sftpserver.c:342:5: note: in expansion of macro ‘SAFE_FREE’ # 351| # 352| /** Free memory space */ # 353|-> #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) # 354| # 355| /** Zero a structure */ Error: GCC_ANALYZER_WARNING (CWE-465): [#def53] libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:47: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘sftp_free’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:353:30: warning[-Wanalyzer-deref-before-check]: check of ‘*sftp.read_packet’ for NULL after already dereferencing it libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:347:5: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:353:32: note: in definition of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:345:5: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:345:5: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:881:15: note: in definition of macro ‘SSH_BUFFER_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:346:5: note: in expansion of macro ‘SSH_BUFFER_FREE’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:353:32: note: in definition of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:347:5: note: in expansion of macro ‘SAFE_FREE’ # 351| # 352| /** Free memory space */ # 353|-> #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) # 354| # 355| /** Zero a structure */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def54] libssh-0.11.1-build/libssh-0.11.1/include/libssh/sftp_priv.h:72:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sftp’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘sftp_open’ libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:33: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:5: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:1026:5: note: in expansion of macro ‘ZERO_STRUCT’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:1046:5: note: in expansion of macro ‘SSH_LOG’ # 70| static inline uint32_t sftp_get_new_id(sftp_session session) # 71| { # 72|-> return ++session->id_counter; # 73| } # 74| Error: GCC_ANALYZER_WARNING (CWE-401): [#def55] libssh-0.11.1-build/libssh-0.11.1/src/auth.c: scope_hint: In function ‘ssh_packet_userauth_info_request’ libssh-0.11.1-build/libssh-0.11.1/src/auth.c:1983:8: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)nprompts, 8)’ libssh-0.11.1-build/libssh-0.11.1/src/auth.c:38: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/buffer.h:60:70: note: in definition of macro ‘ssh_buffer_unpack’ libssh-0.11.1-build/libssh-0.11.1/src/auth.c:35: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/auth.c:1968:5: note: in expansion of macro ‘SSH_LOG’ # 1981| session->kbdint->nanswers = nprompts; # 1982| session->kbdint->prompts = calloc(nprompts, sizeof(char *)); # 1983|-> if (session->kbdint->prompts == NULL) { # 1984| session->kbdint->nprompts = 0; # 1985| ssh_set_error_oom(session); Error: GCC_ANALYZER_WARNING (CWE-401): [#def56] libssh-0.11.1-build/libssh-0.11.1/src/auth.c:1993:8: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)nprompts, 1)’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/buffer.h:60:70: note: in definition of macro ‘ssh_buffer_unpack’ libssh-0.11.1-build/libssh-0.11.1/src/auth.c:1968:5: note: in expansion of macro ‘SSH_LOG’ # 1991| # 1992| session->kbdint->echo = calloc(nprompts, sizeof(unsigned char)); # 1993|-> if (session->kbdint->echo == NULL) { # 1994| session->kbdint->nprompts = 0; # 1995| ssh_set_error_oom(session); Error: GCC_ANALYZER_WARNING (CWE-775): [#def57] libssh-0.11.1-build/libssh-0.11.1/src/bind.c: scope_hint: In function ‘ssh_bind_accept_fd’ libssh-0.11.1-build/libssh-0.11.1/src/bind.c:435:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sshbind.bindfd’ # 433| } # 434| # 435|-> session->server = 1; # 436| # 437| /* Copy options from bind to session */ Error: GCC_ANALYZER_WARNING (CWE-775): [#def58] libssh-0.11.1-build/libssh-0.11.1/src/bind.c: scope_hint: In function ‘ssh_bind_accept’ libssh-0.11.1-build/libssh-0.11.1/src/bind.c:575:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sshbind.bindfd’ # 573| # 574| fd = accept(sshbind->bindfd, NULL, NULL); # 575|-> if (fd == SSH_INVALID_SOCKET) { # 576| char err_msg[SSH_ERRNO_MSG_MAX] = {0}; # 577| if (errno == EINTR) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def59] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_buffer.c:7: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/buffer.c: scope_hint: In function ‘realloc_buffer’ libssh-0.11.1-build/libssh-0.11.1/src/buffer.c:106:8: warning[-Wanalyzer-malloc-leak]: leak of ‘new’ libssh-0.11.1-build/libssh-0.11.1/src/buffer.c:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_buffer.c:242:10: note: in expansion of macro ‘ssh_buffer_pack’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_buffer.c:242:10: note: in expansion of macro ‘ssh_buffer_pack’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_buffer.c:247:10: note: in expansion of macro ‘ssh_buffer_pack’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_buffer.c:247:10: note: in expansion of macro ‘ssh_buffer_pack’ # 104| do_abort = true; # 105| } # 106|-> if (do_abort) { # 107| abort(); # 108| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def60] libssh-0.11.1-build/libssh-0.11.1/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’ libssh-0.11.1-build/libssh-0.11.1/src/buffer.c:1227:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ libssh-0.11.1-build/libssh-0.11.1/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’ libssh-0.11.1-build/libssh-0.11.1/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’ # 1225| } # 1226| # 1227|-> o.data = va_arg(ap, void **); # 1228| count++; # 1229| Error: GCC_ANALYZER_WARNING (CWE-688): [#def61] libssh-0.11.1-build/libssh-0.11.1/src/ecdh_crypto.c: scope_hint: In function ‘ecdh_build_k’ libssh-0.11.1-build/libssh-0.11.1/src/ecdh_crypto.c:339:8: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected libssh-0.11.1-build/libssh-0.11.1/src/ecdh_crypto.c: scope_hint: In function ‘ecdh_build_k’ <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 337| } # 338| curve = ecdh_kex_type_to_curve(next_crypto->kex_type); # 339|-> rc = OSSL_PARAM_BLD_push_utf8_string(param_bld, # 340| OSSL_PKEY_PARAM_GROUP_NAME, # 341| (char *)curve, Error: GCC_ANALYZER_WARNING (CWE-476): [#def62] libssh-0.11.1-build/libssh-0.11.1/src/external/chacha.c: scope_hint: In function ‘chacha_encrypt_bytes’ libssh-0.11.1-build/libssh-0.11.1/src/external/chacha.c:206:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ctarget’ libssh-0.11.1-build/libssh-0.11.1/src/external/chacha.c:138:13: note: in expansion of macro ‘QUARTERROUND’ # 204| if (bytes <= 64) { # 205| if (bytes < 64) { # 206|-> for (i = 0;i < bytes;++i) ctarget[i] = c[i]; # 207| } # 208| x->input[12] = j12; Error: GCC_ANALYZER_WARNING (CWE-401): [#def63] libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c: scope_hint: In function ‘ssh_packet_userauth_gssapi_token_server’ libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c:69:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ssh_gssapi_name_to_char(client_name)’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:192: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/session.h:25: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/gssapi.h:26: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/gssapi.c:32: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/callbacks.h:561:13: note: in definition of macro ‘SSH_PACKET_CALLBACK’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/callbacks.h:467:4: note: in definition of macro ‘ssh_callbacks_exists’ # 67| # 68| do { # 69|-> gss_display_status(&dummy_min, # 70| maj_stat, # 71| GSS_C_GSS_CODE, Error: GCC_ANALYZER_WARNING (CWE-401): [#def64] libssh-0.11.1-build/libssh-0.11.1/src/kex.c: scope_hint: In function ‘ssh_kex_select_methods’ libssh-0.11.1-build/libssh-0.11.1/src/kex.c:976:40: warning[-Wanalyzer-malloc-leak]: leak of ‘*crypto.kex_methods[i]’ # 974| if (aead_hmac) { # 975| free(crypto->kex_methods[i]); # 976|-> crypto->kex_methods[i] = strdup(aead_hmac); # 977| } # 978| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def65] libssh-0.11.1-build/libssh-0.11.1/src/kex.c:987:36: warning[-Wanalyzer-malloc-leak]: leak of ‘*crypto.kex_methods[i]’ # 985| } else if ((i >= SSH_LANG_C_S) && (crypto->kex_methods[i] == NULL)) { # 986| /* we can safely do that for languages */ # 987|-> crypto->kex_methods[i] = strdup(""); # 988| } # 989| } Error: COMPILER_WARNING (CWE-477): [#def66] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c: scope_hint: In function ‘ssh_userauth_privatekey_file’ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:130:3: warning[-Wdeprecated-declarations]: ‘publickey_from_file’ is deprecated # 130 | pubkey = publickey_from_file(session, pubkeyfile, &type); # | ^~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:890: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:32: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/legacy.h:101:38: note: declared here # 101 | SSH_DEPRECATED LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename, # | ^~~~~~~~~~~~~~~~~~~ # 128| snprintf(pubkeyfile, klen, "%s.pub", filename); # 129| # 130|-> pubkey = publickey_from_file(session, pubkeyfile, &type); # 131| if (pubkey == NULL) { # 132| SSH_LOG(SSH_LOG_RARE, "Public key file %s not found. Trying to generate it.", pubkeyfile); Error: COMPILER_WARNING (CWE-477): [#def67] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:134:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 134 | privkey = privatekey_from_file(session, filename, 0, passphrase); # | ^~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/legacy.h:96:43: note: declared here # 96 | SSH_DEPRECATED LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename, # | ^~~~~~~~~~~~~~~~~~~~ # 132| SSH_LOG(SSH_LOG_RARE, "Public key file %s not found. Trying to generate it.", pubkeyfile); # 133| /* auto-detect the key type with type=0 */ # 134|-> privkey = privatekey_from_file(session, filename, 0, passphrase); # 135| } else { # 136| SSH_LOG(SSH_LOG_RARE, "Public key file %s loaded.", pubkeyfile); Error: COMPILER_WARNING (CWE-477): [#def68] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:137:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 137 | privkey = privatekey_from_file(session, filename, type, passphrase); # | ^~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/legacy.h:96:43: note: declared here # 96 | SSH_DEPRECATED LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename, # | ^~~~~~~~~~~~~~~~~~~~ # 135| } else { # 136| SSH_LOG(SSH_LOG_RARE, "Public key file %s loaded.", pubkeyfile); # 137|-> privkey = privatekey_from_file(session, filename, type, passphrase); # 138| } # 139| if (privkey == NULL) { Error: COMPILER_WARNING (CWE-477): [#def69] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:144:3: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 144 | privatekey_free(privkey); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/legacy.h:95:32: note: declared here # 95 | SSH_DEPRECATED LIBSSH_API void privatekey_free(ssh_private_key prv); # | ^~~~~~~~~~~~~~~ # 142| /* ssh_userauth_pubkey is responsible for taking care of null-pubkey */ # 143| rc = ssh_userauth_pubkey(session, username, pubkey, privkey); # 144|-> privatekey_free(privkey); # 145| # 146| error: Error: COMPILER_WARNING (CWE-477): [#def70] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c: scope_hint: In function ‘channel_get_exit_status’ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:198:3: warning[-Wdeprecated-declarations]: ‘ssh_channel_get_exit_status’ is deprecated # 198 | return ssh_channel_get_exit_status(channel); # | ^~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:471:31: note: declared here # 471 | SSH_DEPRECATED LIBSSH_API int ssh_channel_get_exit_status(ssh_channel channel); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 196| # 197| int channel_get_exit_status(ssh_channel channel){ # 198|-> return ssh_channel_get_exit_status(channel); # 199| } # 200| Error: COMPILER_WARNING (CWE-477): [#def71] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c: scope_hint: In function ‘channel_select’ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:296:3: warning[-Wdeprecated-declarations]: ‘ssh_channel_select’ is deprecated # 296 | return ssh_channel_select(readchans, writechans, exceptchans, timeout); # | ^~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:584:31: note: declared here # 584 | SSH_DEPRECATED LIBSSH_API int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct # | ^~~~~~~~~~~~~~~~~~ # 294| int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct # 295| timeval * timeout){ # 296|-> return ssh_channel_select(readchans, writechans, exceptchans, timeout); # 297| } # 298| Error: GCC_ANALYZER_WARNING (CWE-476): [#def72] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c: scope_hint: In function ‘publickey_from_privatekey’ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:390:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘prv’ # 388| } # 389| # 390|-> privkey->type = prv->type; # 391| privkey->type_c = ssh_key_type_to_char(privkey->type); # 392| privkey->flags = SSH_KEY_FLAG_PRIVATE | SSH_KEY_FLAG_PUBLIC; Error: COMPILER_WARNING (CWE-477): [#def73] libssh-0.11.1-build/libssh-0.11.1/src/legacy.c: scope_hint: In function ‘ssh_try_publickey_from_file’ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:726:5: warning[-Wdeprecated-declarations]: ‘publickey_from_file’ is deprecated # 726 | pubkey_string = publickey_from_file(session, pubkey_file, &pubkey_type); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:493:12: note: declared here # 493 | ssh_string publickey_from_file(ssh_session session, const char *filename, # | ^~~~~~~~~~~~~~~~~~~ # 724| * the public as a string, and the private filename as an argument # 725| */ # 726|-> pubkey_string = publickey_from_file(session, pubkey_file, &pubkey_type); # 727| if (pubkey_string == NULL) { # 728| SSH_LOG(SSH_LOG_PACKET, Error: GCC_ANALYZER_WARNING (CWE-688): [#def74] libssh-0.11.1-build/libssh-0.11.1/src/misc.c: scope_hint: In function ‘ssh_path_expand_tilde.part.0’ libssh-0.11.1-build/libssh-0.11.1/src/misc.c:1147:14: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 1145| return NULL; # 1146| } # 1147|-> ld = strlen(p); # 1148| h = strdup(pw->pw_dir); # 1149| #endif Error: GCC_ANALYZER_WARNING (CWE-401): [#def75] libssh-0.11.1-build/libssh-0.11.1/src/options.c: scope_hint: In function ‘ssh_options_copy’ libssh-0.11.1-build/libssh-0.11.1/src/options.c:122:18: warning[-Wanalyzer-malloc-leak]: leak of ‘id’ # 120| int rc; # 121| # 122|-> id = strdup((char *)it->data); # 123| if (id == NULL) { # 124| ssh_free(new); Error: GCC_ANALYZER_WARNING (CWE-476): [#def76] libssh-0.11.1-build/libssh-0.11.1/src/packet.c: scope_hint: In function ‘packet_send2’ libssh-0.11.1-build/libssh-0.11.1/src/packet.c:1695:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*session.next_crypto’ # 1693| etm = crypto->out_hmac_etm; # 1694| } else { # 1695|-> hmac_type = session->next_crypto->out_hmac; # 1696| } # 1697| Error: COMPILER_WARNING (CWE-477): [#def77] libssh-0.11.1-build/libssh-0.11.1/src/scp.c: scope_hint: In function ‘ssh_scp_new’ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:110:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 110 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/scp.c:30: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 108| # 109| error: # 110|-> ssh_scp_free(scp); # 111| return NULL; # 112| } Error: COMPILER_WARNING (CWE-477): [#def78] libssh-0.11.1-build/libssh-0.11.1/src/scp.c: scope_hint: In function ‘ssh_scp_free’ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:303:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 303 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:249:5: note: declared here # 249 | int ssh_scp_close(ssh_scp scp) # | ^~~~~~~~~~~~~ # 301| # 302| if (scp->state != SSH_SCP_NEW) { # 303|-> ssh_scp_close(scp); # 304| } # 305| Error: COMPILER_WARNING (CWE-477): [#def79] libssh-0.11.1-build/libssh-0.11.1/src/scp.c: scope_hint: In function ‘ssh_scp_push_file’ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:577:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file64’ is deprecated # 577 | return ssh_scp_push_file64(scp, filename, (uint64_t) size, mode); # | ^~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:472:5: note: declared here # 472 | int ssh_scp_push_file64(ssh_scp scp, const char *filename, uint64_t size, # | ^~~~~~~~~~~~~~~~~~~ # 575| int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int mode) # 576| { # 577|-> return ssh_scp_push_file64(scp, filename, (uint64_t) size, mode); # 578| } # 579| Error: COMPILER_WARNING (CWE-477): [#def80] libssh-0.11.1-build/libssh-0.11.1/src/scp.c: scope_hint: In function ‘ssh_scp_read’ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:1023:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 1023 | rc = ssh_scp_accept_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/scp.c:969:5: note: declared here # 969 | int ssh_scp_accept_request(ssh_scp scp) # | ^~~~~~~~~~~~~~~~~~~~~~ # 1021| scp->request_type == SSH_SCP_REQUEST_NEWFILE) # 1022| { # 1023|-> rc = ssh_scp_accept_request(scp); # 1024| if (rc == SSH_ERROR) { # 1025| return rc; Error: GCC_ANALYZER_WARNING (CWE-401): [#def81] libssh-0.11.1-build/libssh-0.11.1/src/session.c: scope_hint: In function ‘ssh_new’ libssh-0.11.1-build/libssh-0.11.1/src/session.c:191:33: warning[-Wanalyzer-malloc-leak]: leak of ‘id’ # 189| # 190| session->auth.state = SSH_AUTH_STATE_NONE; # 191|-> session->auth.service_state = SSH_AUTH_SERVICE_NONE; # 192| # 193| return session; Error: GCC_ANALYZER_WARNING (CWE-401): [#def82] libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘sftp_init’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:434:16: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:51: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:437:10: note: in expansion of macro ‘ssh_buffer_pack’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:451:5: note: in expansion of macro ‘SSH_BUFFER_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:466:10: note: in expansion of macro ‘ssh_buffer_unpack’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:475:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:488:9: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:298:24: note: in definition of macro ‘ssh_set_error_oom’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:508:13: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:509:13: note: in expansion of macro ‘SAFE_FREE’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:509:13: note: in expansion of macro ‘SAFE_FREE’ # 432| ssh_set_error_oom(sftp->session); # 433| sftp_set_error(sftp, SSH_FX_FAILURE); # 434|-> return -1; # 435| } # 436| Error: GCC_ANALYZER_WARNING (CWE-476): [#def83] libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘sftp_open’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c:1022:31: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sftp’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:298:24: note: in definition of macro ‘ssh_set_error_oom’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:298:24: note: in definition of macro ‘ssh_set_error_oom’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:298:24: note: in definition of macro ‘ssh_set_error_oom’ # 1020| buffer = ssh_buffer_new(); # 1021| if (buffer == NULL) { # 1022|-> ssh_set_error_oom(sftp->session); # 1023| return NULL; # 1024| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def84] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:507:8: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 505| # 506| out = ssh_buffer_new(); # 507|-> if (out == NULL) { # 508| return -1; # 509| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def85] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_opendir’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:507:8: warning[-Wanalyzer-malloc-leak]: leak of ‘h’ # 505| # 506| out = ssh_buffer_new(); # 507|-> if (out == NULL) { # 508| return -1; # 509| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def86] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘sftp_handle_alloc’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:666:12: warning[-Wanalyzer-malloc-leak]: leak of ‘*sftp.handles’ # 664| if (sftp->handles == NULL) { # 665| sftp->handles = calloc(SFTP_HANDLES, sizeof(void *)); # 666|-> if (sftp->handles == NULL) { # 667| return NULL; # 668| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def87] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_read’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:956:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 954| # 955| h = sftp_handle(sftp, handle); # 956|-> if (h->type == SFTP_FILE_HANDLE) { # 957| fd = h->fd; # 958| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def88] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_write’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:1014:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1012| # 1013| h = sftp_handle(sftp, handle); # 1014|-> if (h->type == SFTP_FILE_HANDLE) { # 1015| fd = h->fd; # 1016| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def89] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_close’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:1059:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1057| # 1058| h = sftp_handle(sftp, handle); # 1059|-> if (h->type == SFTP_FILE_HANDLE) { # 1060| int fd = h->fd; # 1061| close(fd); Error: GCC_ANALYZER_WARNING (CWE-476): [#def90] libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c: scope_hint: In function ‘process_readdir’ libssh-0.11.1-build/libssh-0.11.1/src/sftpserver.c:1226:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 1224| # 1225| h = sftp_handle(sftp, client_msg->handle); # 1226|-> if (h->type == SFTP_DIR_HANDLE) { # 1227| dir = h->dirp; # 1228| handle_name = h->name; Error: GCC_ANALYZER_WARNING (CWE-775): [#def91] libssh-0.11.1-build/libssh-0.11.1/src/socket.c: scope_hint: In function ‘ssh_execute_command’ libssh-0.11.1-build/libssh-0.11.1/src/socket.c:941:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’ # 939| /* Ignore anything on the stderr */ # 940| dup2(devnull, STDERR_FILENO); # 941|-> close(in); # 942| close(out); # 943| rc = execv(args[0], (char * const *)args); Error: GCC_ANALYZER_WARNING (CWE-1341): [#def92] libssh-0.11.1-build/libssh-0.11.1/src/socket.c:942:5: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘out’ libssh-0.11.1-build/libssh-0.11.1/src/socket.c:52: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/socket.c:979:5: note: in expansion of macro ‘SSH_LOG’ # 940| dup2(devnull, STDERR_FILENO); # 941| close(in); # 942|-> close(out); # 943| rc = execv(args[0], (char * const *)args); # 944| if (rc < 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def93] libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c: scope_hint: In function ‘crypt_set_algorithms2’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:293:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:45: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:290:5: note: in expansion of macro ‘SSH_LOG’ # 291| # 292| session->next_crypto->out_cipher = cipher_new(i); # 293|-> if (session->next_crypto->out_cipher == NULL) { # 294| ssh_set_error_oom(session); # 295| return SSH_ERROR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def94] libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:352:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:290:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:328:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:349:5: note: in expansion of macro ‘SSH_LOG’ # 350| # 351| session->next_crypto->in_cipher = cipher_new(i); # 352|-> if (session->next_crypto->in_cipher == NULL) { # 353| ssh_set_error_oom(session); # 354| return SSH_ERROR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def95] libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c: scope_hint: In function ‘crypt_set_algorithms_server’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:454:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:451:5: note: in expansion of macro ‘SSH_LOG’ # 452| # 453| session->next_crypto->out_cipher = cipher_new(i); # 454|-> if (session->next_crypto->out_cipher == NULL) { # 455| ssh_set_error_oom(session); # 456| return SSH_ERROR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def96] libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:509:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:451:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:486:5: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/wrapper.c:506:5: note: in expansion of macro ‘SSH_LOG’ # 507| # 508| session->next_crypto->in_cipher = cipher_new(i); # 509|-> if (session->next_crypto->in_cipher == NULL) { # 510| ssh_set_error_oom(session); # 511| return SSH_ERROR; Error: GCC_ANALYZER_WARNING: [#def97] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_auth_cert.c: scope_hint: In function ‘agent_cert_setup_explicit’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_auth_cert.c:736:10: warning[-Wanalyzer-fd-use-without-check]: ‘read’ on possibly invalid file descriptor ‘open(&orig_doe_ssh_key, 0)’ # 734| fd = open(orig_doe_ssh_key, O_RDONLY); # 735| assert_true(fd > 0); # 736|-> rc = read(fd, keydata, sizeof(keydata)); # 737| assert_true(rc > 0); # 738| keydata[rc] = '\0'; Error: GCC_ANALYZER_WARNING: [#def98] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_connect.c: scope_hint: In function ‘torture_connect_socket’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_connect.c:220:10: warning[-Wanalyzer-fd-use-without-check]: ‘connect’ on possibly invalid file descriptor ‘sock_fd’ # 218| assert_true(sock_fd > 2); # 219| # 220|-> rc = connect(sock_fd, (struct sockaddr *)&server_addr, sizeof(server_addr)); # 221| assert_return_code(rc, errno); # 222| Error: GCC_ANALYZER_WARNING: [#def99] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_request_pty_modes.c: scope_hint: In function ‘torture_request_pty_modes_use_stdin_modes’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_request_pty_modes.c:183:5: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘stdin_backup_fd’ libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_request_pty_modes.c:26: included_from: Included from here. # 181| # 182| /* revert the changes to STDIN first! */ # 183|-> dup2(stdin_backup_fd, STDIN_FILENO); # 184| close(stdin_backup_fd); # 185| close(master_fd); Error: GCC_ANALYZER_WARNING: [#def100] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_request_pty_modes.c: scope_hint: In function ‘torture_request_pty_modes_use_default_modes’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_request_pty_modes.c:226:5: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘stdin_backup_fd’ # 224| # 225| /* revert the changes to STDIN first! */ # 226|-> dup2(stdin_backup_fd, STDIN_FILENO); # 227| close(stdin_backup_fd); # 228| Error: COMPILER_WARNING (CWE-477): [#def101] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:188:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 188 | scp = ssh_scp_new(session, SSH_SCP_WRITE, ts->tmp_dir_basename); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:33: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:28: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 186| # 187| /* When writing the file_name must be the directory name */ # 188|-> scp = ssh_scp_new(session, SSH_SCP_WRITE, ts->tmp_dir_basename); # 189| assert_non_null(scp); # 190| Error: COMPILER_WARNING (CWE-477): [#def102] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:191:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 191 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 189| assert_non_null(scp); # 190| # 191|-> rc = ssh_scp_init(scp); # 192| assert_ssh_return_code(session, rc); # 193| Error: COMPILER_WARNING (CWE-477): [#def103] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:199:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated # 199 | rc = ssh_scp_push_file(scp, "a", BUF_SIZE, 0644); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:596:31: note: declared here # 596 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms); # | ^~~~~~~~~~~~~~~~~ # 197| /* For ssh_scp_push_file(), the file_name is the name of the file without # 198| * path */ # 199|-> rc = ssh_scp_push_file(scp, "a", BUF_SIZE, 0644); # 200| assert_ssh_return_code(session, rc); # 201| Error: COMPILER_WARNING (CWE-477): [#def104] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:202:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated # 202 | rc = ssh_scp_write(scp, expected_a, BUF_SIZE); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:604:31: note: declared here # 604 | SSH_DEPRECATED LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); # | ^~~~~~~~~~~~~ # 200| assert_ssh_return_code(session, rc); # 201| # 202|-> rc = ssh_scp_write(scp, expected_a, BUF_SIZE); # 203| assert_ssh_return_code(session, rc); # 204| Error: COMPILER_WARNING (CWE-477): [#def105] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:206:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 206 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 204| # 205| /* Cleanup */ # 206|-> ssh_scp_close(scp); # 207| ssh_scp_free(scp); # 208| Error: COMPILER_WARNING (CWE-477): [#def106] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:207:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 207 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 205| /* Cleanup */ # 206| ssh_scp_close(scp); # 207|-> ssh_scp_free(scp); # 208| # 209| /* Open file and check content */ Error: COMPILER_WARNING (CWE-477): [#def107] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_recursive’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:252:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 252 | scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 250| # 251| /* When writing the file_name must be the directory name */ # 252|-> scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # 253| ts->tmp_dir_basename); # 254| assert_non_null(scp); Error: COMPILER_WARNING (CWE-477): [#def108] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:256:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 256 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 254| assert_non_null(scp); # 255| # 256|-> rc = ssh_scp_init(scp); # 257| assert_ssh_return_code(session, rc); # 258| Error: COMPILER_WARNING (CWE-477): [#def109] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:260:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_directory’ is deprecated # 260 | rc = ssh_scp_push_directory(scp, "test_dir", 0755); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:595:31: note: declared here # 595 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode); # | ^~~~~~~~~~~~~~~~~~~~~~ # 258| # 259| /* Push directory where the new file will be copied */ # 260|-> rc = ssh_scp_push_directory(scp, "test_dir", 0755); # 261| assert_ssh_return_code(session, rc); # 262| Error: COMPILER_WARNING (CWE-477): [#def110] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:267:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated # 267 | rc = ssh_scp_push_file(scp, "b", BUF_SIZE, 0644); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:596:31: note: declared here # 596 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms); # | ^~~~~~~~~~~~~~~~~ # 265| /* For ssh_scp_push_file(), the file_name is the name of the file without # 266| * path */ # 267|-> rc = ssh_scp_push_file(scp, "b", BUF_SIZE, 0644); # 268| assert_ssh_return_code(session, rc); # 269| Error: COMPILER_WARNING (CWE-477): [#def111] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:270:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated # 270 | rc = ssh_scp_write(scp, expected_b, BUF_SIZE); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:604:31: note: declared here # 604 | SSH_DEPRECATED LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); # | ^~~~~~~~~~~~~ # 268| assert_ssh_return_code(session, rc); # 269| # 270|-> rc = ssh_scp_write(scp, expected_b, BUF_SIZE); # 271| assert_ssh_return_code(session, rc); # 272| Error: COMPILER_WARNING (CWE-477): [#def112] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:274:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_leave_directory’ is deprecated # 274 | rc = ssh_scp_leave_directory(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:592:31: note: declared here # 592 | SSH_DEPRECATED LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~ # 272| # 273| /* Leave the directory */ # 274|-> rc = ssh_scp_leave_directory(scp); # 275| assert_ssh_return_code(session, rc); # 276| Error: COMPILER_WARNING (CWE-477): [#def113] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:278:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 278 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 276| # 277| /* Cleanup */ # 278|-> ssh_scp_close(scp); # 279| ssh_scp_free(scp); # 280| Error: COMPILER_WARNING (CWE-477): [#def114] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:279:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 279 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 277| /* Cleanup */ # 278| ssh_scp_close(scp); # 279|-> ssh_scp_free(scp); # 280| # 281| /* Open file and check content */ Error: COMPILER_WARNING (CWE-477): [#def115] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_download’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:348:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 348 | scp = ssh_scp_new(session, SSH_SCP_READ, buf); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 346| # 347| /* When reading, the location is the file path */ # 348|-> scp = ssh_scp_new(session, SSH_SCP_READ, buf); # 349| assert_non_null(scp); # 350| Error: COMPILER_WARNING (CWE-477): [#def116] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:351:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 351 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 349| assert_non_null(scp); # 350| # 351|-> rc = ssh_scp_init(scp); # 352| assert_ssh_return_code(session, rc); # 353| Error: COMPILER_WARNING (CWE-477): [#def117] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:354:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 354 | rc = ssh_scp_pull_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 352| assert_ssh_return_code(session, rc); # 353| # 354|-> rc = ssh_scp_pull_request(scp); # 355| assert_int_equal(rc, SSH_SCP_REQUEST_NEWFILE); # 356| Error: COMPILER_WARNING (CWE-477): [#def118] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:357:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated # 357 | size = ssh_scp_request_get_size(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:601:34: note: declared here # 601 | SSH_DEPRECATED LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~ # 355| assert_int_equal(rc, SSH_SCP_REQUEST_NEWFILE); # 356| # 357|-> size = ssh_scp_request_get_size(scp); # 358| assert_int_equal(size, BUF_SIZE); # 359| Error: COMPILER_WARNING (CWE-477): [#def119] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:360:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated # 360 | mode = ssh_scp_request_get_permissions(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 600 | SSH_DEPRECATED LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 358| assert_int_equal(size, BUF_SIZE); # 359| # 360|-> mode = ssh_scp_request_get_permissions(scp); # 361| assert_int_equal(mode, 0644); # 362| Error: COMPILER_WARNING (CWE-477): [#def120] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:363:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated # 363 | remote_file = ssh_scp_request_get_filename(scp); # | ^~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 599 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 361| assert_int_equal(mode, 0644); # 362| # 363|-> remote_file = ssh_scp_request_get_filename(scp); # 364| assert_non_null(remote_file); # 365| assert_string_equal(remote_file, "a"); Error: COMPILER_WARNING (CWE-477): [#def121] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:367:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 367 | rc = ssh_scp_accept_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 587 | SSH_DEPRECATED LIBSSH_API int ssh_scp_accept_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~ # 365| assert_string_equal(remote_file, "a"); # 366| # 367|-> rc = ssh_scp_accept_request(scp); # 368| assert_ssh_return_code(session, rc); # 369| Error: COMPILER_WARNING (CWE-477): [#def122] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:370:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated # 370 | rc = ssh_scp_read(scp, buf, BUF_SIZE); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:598:31: note: declared here # 598 | SSH_DEPRECATED LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size); # | ^~~~~~~~~~~~ # 368| assert_ssh_return_code(session, rc); # 369| # 370|-> rc = ssh_scp_read(scp, buf, BUF_SIZE); # 371| assert_int_equal(rc, size); # 372| Error: COMPILER_WARNING (CWE-477): [#def123] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:376:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 376 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 374| # 375| /* Cleanup */ # 376|-> ssh_scp_close(scp); # 377| ssh_scp_free(scp); # 378| } Error: COMPILER_WARNING (CWE-477): [#def124] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:377:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 377 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 375| /* Cleanup */ # 376| ssh_scp_close(scp); # 377|-> ssh_scp_free(scp); # 378| } # 379| Error: COMPILER_WARNING (CWE-477): [#def125] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_download_recursive’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:427:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 427 | scp = ssh_scp_new(session, SSH_SCP_READ | SSH_SCP_RECURSIVE, # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 425| # 426| /* Copy the directory containing the file "b" */ # 427|-> scp = ssh_scp_new(session, SSH_SCP_READ | SSH_SCP_RECURSIVE, # 428| ts->tmp_dir_basename); # 429| assert_non_null(scp); Error: COMPILER_WARNING (CWE-477): [#def126] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:431:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 431 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 429| assert_non_null(scp); # 430| # 431|-> rc = ssh_scp_init(scp); # 432| assert_ssh_return_code(session, rc); # 433| Error: COMPILER_WARNING (CWE-477): [#def127] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:435:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 435 | rc = ssh_scp_pull_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 433| # 434| /* Receive the directory */ # 435|-> rc = ssh_scp_pull_request(scp); # 436| assert_int_equal(rc, SSH_SCP_REQUEST_NEWDIR); # 437| Error: COMPILER_WARNING (CWE-477): [#def128] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:438:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated # 438 | mode = ssh_scp_request_get_permissions(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 600 | SSH_DEPRECATED LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 436| assert_int_equal(rc, SSH_SCP_REQUEST_NEWDIR); # 437| # 438|-> mode = ssh_scp_request_get_permissions(scp); # 439| assert_int_equal(mode, 0700); # 440| Error: COMPILER_WARNING (CWE-477): [#def129] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:441:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated # 441 | remote_file = ssh_scp_request_get_filename(scp); # | ^~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 599 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 439| assert_int_equal(mode, 0700); # 440| # 441|-> remote_file = ssh_scp_request_get_filename(scp); # 442| assert_non_null(remote_file); # 443| assert_string_equal(remote_file, ts->tmp_dir_basename); Error: COMPILER_WARNING (CWE-477): [#def130] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:445:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 445 | rc = ssh_scp_accept_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 587 | SSH_DEPRECATED LIBSSH_API int ssh_scp_accept_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~ # 443| assert_string_equal(remote_file, ts->tmp_dir_basename); # 444| # 445|-> rc = ssh_scp_accept_request(scp); # 446| assert_ssh_return_code(session, rc); # 447| Error: COMPILER_WARNING (CWE-477): [#def131] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:449:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 449 | rc = ssh_scp_pull_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 447| # 448| /* Receive the file "b" */ # 449|-> rc = ssh_scp_pull_request(scp); # 450| assert_int_equal(rc, SSH_SCP_REQUEST_NEWFILE); # 451| Error: COMPILER_WARNING (CWE-477): [#def132] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:452:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated # 452 | size = ssh_scp_request_get_size(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:601:34: note: declared here # 601 | SSH_DEPRECATED LIBSSH_API size_t ssh_scp_request_get_size(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~ # 450| assert_int_equal(rc, SSH_SCP_REQUEST_NEWFILE); # 451| # 452|-> size = ssh_scp_request_get_size(scp); # 453| assert_int_equal(size, BUF_SIZE); # 454| Error: COMPILER_WARNING (CWE-477): [#def133] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:455:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated # 455 | mode = ssh_scp_request_get_permissions(scp); # | ^~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:600:31: note: declared here # 600 | SSH_DEPRECATED LIBSSH_API int ssh_scp_request_get_permissions(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 453| assert_int_equal(size, BUF_SIZE); # 454| # 455|-> mode = ssh_scp_request_get_permissions(scp); # 456| assert_int_equal(mode, 0644); # 457| Error: COMPILER_WARNING (CWE-477): [#def134] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:458:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated # 458 | remote_file = ssh_scp_request_get_filename(scp); # | ^~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:599:39: note: declared here # 599 | SSH_DEPRECATED LIBSSH_API const char *ssh_scp_request_get_filename(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 456| assert_int_equal(mode, 0644); # 457| # 458|-> remote_file = ssh_scp_request_get_filename(scp); # 459| assert_non_null(remote_file); # 460| assert_string_equal(remote_file, "b"); Error: COMPILER_WARNING (CWE-477): [#def135] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:462:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated # 462 | rc = ssh_scp_accept_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:587:31: note: declared here # 587 | SSH_DEPRECATED LIBSSH_API int ssh_scp_accept_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~ # 460| assert_string_equal(remote_file, "b"); # 461| # 462|-> rc = ssh_scp_accept_request(scp); # 463| assert_ssh_return_code(session, rc); # 464| Error: COMPILER_WARNING (CWE-477): [#def136] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:465:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated # 465 | rc = ssh_scp_read(scp, buf, BUF_SIZE); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:598:31: note: declared here # 598 | SSH_DEPRECATED LIBSSH_API int ssh_scp_read(ssh_scp scp, void *buffer, size_t size); # | ^~~~~~~~~~~~ # 463| assert_ssh_return_code(session, rc); # 464| # 465|-> rc = ssh_scp_read(scp, buf, BUF_SIZE); # 466| assert_int_equal(rc, size); # 467| Error: COMPILER_WARNING (CWE-477): [#def137] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:472:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 472 | rc = ssh_scp_pull_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 470| # 471| /* Receive end of directory */ # 472|-> rc = ssh_scp_pull_request(scp); # 473| assert_int_equal(rc, SSH_SCP_REQUEST_ENDDIR); # 474| Error: COMPILER_WARNING (CWE-477): [#def138] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:476:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated # 476 | rc = ssh_scp_pull_request(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:594:31: note: declared here # 594 | SSH_DEPRECATED LIBSSH_API int ssh_scp_pull_request(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~ # 474| # 475| /* Receive end of communication */ # 476|-> rc = ssh_scp_pull_request(scp); # 477| assert_int_equal(rc, SSH_SCP_REQUEST_EOF); # 478| Error: COMPILER_WARNING (CWE-477): [#def139] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:480:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 480 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 478| # 479| /* Cleanup */ # 480|-> ssh_scp_close(scp); # 481| ssh_scp_free(scp); # 482| } Error: COMPILER_WARNING (CWE-477): [#def140] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:481:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 481 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 479| /* Cleanup */ # 480| ssh_scp_close(scp); # 481|-> ssh_scp_free(scp); # 482| } # 483| Error: COMPILER_WARNING (CWE-477): [#def141] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_newline’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:513:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 513 | scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 511| # 512| /* When writing the file_name must be the directory name */ # 513|-> scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # 514| ts->tmp_dir_basename); # 515| assert_non_null(scp); Error: COMPILER_WARNING (CWE-477): [#def142] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:517:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 517 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 515| assert_non_null(scp); # 516| # 517|-> rc = ssh_scp_init(scp); # 518| assert_ssh_return_code(session, rc); # 519| Error: COMPILER_WARNING (CWE-477): [#def143] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:521:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_directory’ is deprecated # 521 | rc = ssh_scp_push_directory(scp, "test_inject", 0755); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:595:31: note: declared here # 595 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode); # | ^~~~~~~~~~~~~~~~~~~~~~ # 519| # 520| /* Push directory where the new file will be copied */ # 521|-> rc = ssh_scp_push_directory(scp, "test_inject", 0755); # 522| assert_ssh_return_code(session, rc); # 523| Error: COMPILER_WARNING (CWE-477): [#def144] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:525:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated # 525 | rc = ssh_scp_push_file(scp, "original\nreplacedC0777 8 injected", 8, 0644); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:596:31: note: declared here # 596 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms); # | ^~~~~~~~~~~~~~~~~ # 523| # 524| /* Try to push file with injected protocol messages */ # 525|-> rc = ssh_scp_push_file(scp, "original\nreplacedC0777 8 injected", 8, 0644); # 526| assert_ssh_return_code(session, rc); # 527| Error: COMPILER_WARNING (CWE-477): [#def145] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:528:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated # 528 | rc = ssh_scp_write(scp, "original", 8); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:604:31: note: declared here # 604 | SSH_DEPRECATED LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); # | ^~~~~~~~~~~~~ # 526| assert_ssh_return_code(session, rc); # 527| # 528|-> rc = ssh_scp_write(scp, "original", 8); # 529| assert_ssh_return_code(session, rc); # 530| Error: COMPILER_WARNING (CWE-477): [#def146] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:532:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_leave_directory’ is deprecated # 532 | rc = ssh_scp_leave_directory(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:592:31: note: declared here # 592 | SSH_DEPRECATED LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~ # 530| # 531| /* Leave the directory */ # 532|-> rc = ssh_scp_leave_directory(scp); # 533| assert_ssh_return_code(session, rc); # 534| Error: COMPILER_WARNING (CWE-477): [#def147] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:536:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 536 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 534| # 535| /* Cleanup */ # 536|-> ssh_scp_close(scp); # 537| ssh_scp_free(scp); # 538| Error: COMPILER_WARNING (CWE-477): [#def148] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:537:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 537 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 535| /* Cleanup */ # 536| ssh_scp_close(scp); # 537|-> ssh_scp_free(scp); # 538| # 539| /* Open the file and check content */ Error: COMPILER_WARNING (CWE-477): [#def149] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_appended_command’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:587:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated # 587 | scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # | ^~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:593:35: note: declared here # 593 | SSH_DEPRECATED LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location); # | ^~~~~~~~~~~ # 585| # 586| /* When writing the file_name must be the directory name */ # 587|-> scp = ssh_scp_new(session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, # 588| buf); # 589| assert_non_null(scp); Error: COMPILER_WARNING (CWE-477): [#def150] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:591:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated # 591 | rc = ssh_scp_init(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:591:31: note: declared here # 591 | SSH_DEPRECATED LIBSSH_API int ssh_scp_init(ssh_scp scp); # | ^~~~~~~~~~~~ # 589| assert_non_null(scp); # 590| # 591|-> rc = ssh_scp_init(scp); # 592| assert_ssh_return_code(session, rc); # 593| Error: COMPILER_WARNING (CWE-477): [#def151] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:595:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_directory’ is deprecated # 595 | rc = ssh_scp_push_directory(scp, ";touch hack", 0755); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:595:31: note: declared here # 595 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_directory(ssh_scp scp, const char *dirname, int mode); # | ^~~~~~~~~~~~~~~~~~~~~~ # 593| # 594| /* Push directory where the new file will be copied */ # 595|-> rc = ssh_scp_push_directory(scp, ";touch hack", 0755); # 596| assert_ssh_return_code(session, rc); # 597| Error: COMPILER_WARNING (CWE-477): [#def152] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:599:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated # 599 | rc = ssh_scp_push_file(scp, "original", 8, 0644); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:596:31: note: declared here # 596 | SSH_DEPRECATED LIBSSH_API int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int perms); # | ^~~~~~~~~~~~~~~~~ # 597| # 598| /* Try to push file */ # 599|-> rc = ssh_scp_push_file(scp, "original", 8, 0644); # 600| assert_ssh_return_code(session, rc); # 601| Error: COMPILER_WARNING (CWE-477): [#def153] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:602:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated # 602 | rc = ssh_scp_write(scp, "original", 8); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:604:31: note: declared here # 604 | SSH_DEPRECATED LIBSSH_API int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len); # | ^~~~~~~~~~~~~ # 600| assert_ssh_return_code(session, rc); # 601| # 602|-> rc = ssh_scp_write(scp, "original", 8); # 603| assert_ssh_return_code(session, rc); # 604| Error: COMPILER_WARNING (CWE-477): [#def154] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:606:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_leave_directory’ is deprecated # 606 | rc = ssh_scp_leave_directory(scp); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:592:31: note: declared here # 592 | SSH_DEPRECATED LIBSSH_API int ssh_scp_leave_directory(ssh_scp scp); # | ^~~~~~~~~~~~~~~~~~~~~~~ # 604| # 605| /* Leave the directory */ # 606|-> rc = ssh_scp_leave_directory(scp); # 607| assert_ssh_return_code(session, rc); # 608| Error: COMPILER_WARNING (CWE-477): [#def155] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:610:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated # 610 | ssh_scp_close(scp); # | ^~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:588:31: note: declared here # 588 | SSH_DEPRECATED LIBSSH_API int ssh_scp_close(ssh_scp scp); # | ^~~~~~~~~~~~~ # 608| # 609| /* Cleanup */ # 610|-> ssh_scp_close(scp); # 611| ssh_scp_free(scp); # 612| Error: COMPILER_WARNING (CWE-477): [#def156] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_scp.c:611:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated # 611 | ssh_scp_free(scp); # | ^~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:590:32: note: declared here # 590 | SSH_DEPRECATED LIBSSH_API void ssh_scp_free(ssh_scp scp); # | ^~~~~~~~~~~~ # 609| /* Cleanup */ # 610| ssh_scp_close(scp); # 611|-> ssh_scp_free(scp); # 612| # 613| /* Make sure the command was not executed */ Error: COMPILER_WARNING (CWE-477): [#def157] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c: scope_hint: In function ‘torture_freed_channel_get_exit_status’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c:504:9: warning[-Wdeprecated-declarations]: ‘ssh_channel_get_exit_status’ is deprecated # 504 | rc = ssh_channel_get_exit_status(channel); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:191: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:33: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c:26: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:471:31: note: declared here # 471 | SSH_DEPRECATED LIBSSH_API int ssh_channel_get_exit_status(ssh_channel channel); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 502| # 503| if (!channel_freed) { # 504|-> rc = ssh_channel_get_exit_status(channel); # 505| assert_ssh_return_code_equal(session, rc, SSH_ERROR); # 506| } Error: COMPILER_WARNING (CWE-477): [#def158] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c: scope_hint: In function ‘torture_pubkey_hash’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c:554:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated # 554 | rc = ssh_get_pubkey_hash(session, NULL); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:575:31: note: declared here # 575 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash); # | ^~~~~~~~~~~~~~~~~~~ # 552| # 553| /* bad arguments */ # 554|-> rc = ssh_get_pubkey_hash(session, NULL); # 555| assert_int_equal(rc, SSH_ERROR); # 556| Error: COMPILER_WARNING (CWE-477): [#def159] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c:557:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated # 557 | rc = ssh_get_pubkey_hash(NULL, (unsigned char **)&hash); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:575:31: note: declared here # 575 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash); # | ^~~~~~~~~~~~~~~~~~~ # 555| assert_int_equal(rc, SSH_ERROR); # 556| # 557|-> rc = ssh_get_pubkey_hash(NULL, (unsigned char **)&hash); # 558| assert_int_equal(rc, SSH_ERROR); # 559| Error: COMPILER_WARNING (CWE-477): [#def160] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_session.c:561:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated # 561 | rc = ssh_get_pubkey_hash(session, (unsigned char **)&hash); # | ^~ libssh-0.11.1-build/libssh-0.11.1/include/libssh/libssh.h:575:31: note: declared here # 575 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash); # | ^~~~~~~~~~~~~~~~~~~ # 559| # 560| /* deprecated, but should be covered by tests! */ # 561|-> rc = ssh_get_pubkey_hash(session, (unsigned char **)&hash); # 562| if (ssh_fips_mode()) { # 563| /* When in FIPS mode, expect the call to fail */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def161] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_read_file’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:94:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 92| li = sftp_limits(t->sftp); # 93| assert_non_null(li); # 94|-> chunk_size = li->max_read_length; # 95| # 96| a.buf = calloc(chunk_size, 1); Error: GCC_ANALYZER_WARNING (CWE-476): [#def162] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:114:15: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘torture_sftp_aio_read_file’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘torture_sftp_aio_read_file’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/priv.h:298:24: note: in definition of macro ‘ssh_set_error_oom’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_read_file’ # 112| file_attr = sftp_stat(t->sftp, SSH_EXECUTABLE); # 113| assert_non_null(file_attr); # 114|-> file_size = file_attr->size; # 115| # 116| total_bytes_requested = 0; Error: GCC_ANALYZER_WARNING (CWE-476): [#def163] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_read_more_than_cap’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:223:35: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 221| /* Try reading more than the max limit */ # 222| bytes = sftp_aio_begin_read(file, # 223|-> li->max_read_length * 2, # 224| &aio); # 225| assert_int_equal(bytes, li->max_read_length); Error: GCC_ANALYZER_WARNING (CWE-476): [#def164] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_write_file’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:263:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 261| li = sftp_limits(t->sftp); # 262| assert_non_null(li); # 263|-> chunk_size = li->max_write_length; # 264| # 265| rd.buf = calloc(chunk_size, 1); Error: GCC_ANALYZER_WARNING (CWE-476): [#def165] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_write_more_than_cap’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:339:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 337| assert_non_null(li); # 338| # 339|-> buf_size = li->max_write_length * 2; # 340| buf = calloc(buf_size, 1); # 341| assert_non_null(buf); Error: GCC_ANALYZER_WARNING (CWE-476): [#def166] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_read_negative’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:381:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 379| li = sftp_limits(t->sftp); # 380| assert_non_null(li); # 381|-> chunk_size = li->max_read_length; # 382| # 383| buf = calloc(chunk_size, 1); Error: GCC_ANALYZER_WARNING (CWE-476): [#def167] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c: scope_hint: In function ‘torture_sftp_aio_write_negative’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_aio.c:459:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 457| li = sftp_limits(t->sftp); # 458| assert_non_null(li); # 459|-> chunk_size = li->max_write_length; # 460| # 461| buf = calloc(chunk_size, 1); Error: GCC_ANALYZER_WARNING (CWE-476): [#def168] libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_limits.c: scope_hint: In function ‘torture_sftp_limits’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_limits.c:139:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 137| } else { # 138| /* Check for the default limits */ # 139|-> assert_int_equal(li->max_packet_length, 34000); # 140| assert_int_equal(li->max_read_length, 32768); # 141| assert_int_equal(li->max_write_length, 32768); Error: GCC_ANALYZER_WARNING (CWE-457): [#def169] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_packet_read.c: scope_hint: In function ‘torture_sftp_packet_read’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_packet_read.c:88:5: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘fds[0]’ # 86| # 87| t->ssh->opts.timeout = 1; # 88|-> ssh_socket_set_fd(t->ssh->socket, fds[0]); # 89| # 90| /* Error: GCC_ANALYZER_WARNING (CWE-476): [#def170] libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c:7: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c: scope_hint: In function ‘torture_sftp_setstat_chown’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c:158:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘torture_sftp_setstat_chown’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c: scope_hint: In function ‘torture_sftp_setstat_chown’ # 156| tmp_attr = sftp_stat(t->sftp, name); # 157| assert_non_null(tmp_attr); # 158|-> assert_int_equal(tmp_attr->uid, pwd->pw_uid); # 159| assert_int_equal(tmp_attr->gid, pwd->pw_gid); # 160| sftp_attributes_free(tmp_attr); Error: GCC_ANALYZER_WARNING (CWE-476): [#def171] libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c: scope_hint: In function ‘torture_sftp_lsetstat_chown’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c:289:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libssh-0.11.1-build/libssh-0.11.1/src/sftp.c: scope_hint: In function ‘torture_sftp_lsetstat_chown’ libssh-0.11.1-build/libssh-0.11.1/tests/client/torture_sftp_setstat.c: scope_hint: In function ‘torture_sftp_lsetstat_chown’ # 287| tmp_attr = sftp_lstat(t->sftp, name); # 288| assert_non_null(tmp_attr); # 289|-> assert_int_equal(tmp_attr->uid, pwd->pw_uid); # 290| assert_int_equal(tmp_attr->gid, pwd->pw_gid); # 291| sftp_attributes_free(tmp_attr); Error: GCC_ANALYZER_WARNING (CWE-775): [#def172] libssh-0.11.1-build/libssh-0.11.1/tests/server/test_server/test_server.c: scope_hint: In function ‘run_server’ libssh-0.11.1-build/libssh-0.11.1/tests/server/test_server/test_server.c:125:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*state.log_file, "a")’ # 123| } # 124| fd = dup2(fileno(f), STDERR_FILENO); # 125|-> if (fd == -1) { # 126| fprintf(stderr, "dup2 of log file to stderr failed: %s\n", # 127| strerror(errno)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def173] libssh-0.11.1-build/libssh-0.11.1/tests/server/test_server/test_server.c:125:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*state.log_file, "a")’ # 123| } # 124| fd = dup2(fileno(f), STDERR_FILENO); # 125|-> if (fd == -1) { # 126| fprintf(stderr, "dup2 of log file to stderr failed: %s\n", # 127| strerror(errno)); Error: GCC_ANALYZER_WARNING (CWE-775): [#def174] libssh-0.11.1-build/libssh-0.11.1/tests/server/test_server/test_server.c:131:12: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*state.log_file, "a")’ # 129| } # 130| fd = dup2(fileno(f), STDOUT_FILENO); # 131|-> if (fd == -1) { # 132| fprintf(stderr, "dup2 of log file to stdout failed: %s\n", # 133| strerror(errno)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def175] libssh-0.11.1-build/libssh-0.11.1/tests/server/test_server/test_server.c:131:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*state.log_file, "a")’ # 129| } # 130| fd = dup2(fileno(f), STDOUT_FILENO); # 131|-> if (fd == -1) { # 132| fprintf(stderr, "dup2 of log file to stdout failed: %s\n", # 133| strerror(errno)); Error: COMPILER_WARNING (CWE-477): [#def176] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_from_file’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:71:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated # 71 | rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:679:5: note: declared here # 679 | int ssh_try_publickey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 69| int type, rc; # 70| # 71|-> rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # 72| # 73| assert_true(rc == 0); Error: COMPILER_WARNING (CWE-477): [#def177] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:80:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated # 80 | rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:679:5: note: declared here # 679 | int ssh_try_publickey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 78| unlink(LIBSSH_RSA_TESTKEY ".pub"); # 79| # 80|-> rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # 81| assert_true(rc == 1); # 82| Error: COMPILER_WARNING (CWE-477): [#def178] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:89:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated # 89 | rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:679:5: note: declared here # 679 | int ssh_try_publickey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 87| unlink(LIBSSH_RSA_TESTKEY); # 88| # 89|-> rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type); # 90| assert_true(rc == -1); # 91| Error: COMPILER_WARNING (CWE-477): [#def179] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_generate_from_privkey’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:132:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated # 132 | rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey_orig, # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:679:5: note: declared here # 679 | int ssh_try_publickey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 130| # 131| /* read the publickey */ # 132|-> rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey_orig, # 133| &type_orig); # 134| assert_true(rc == 0); Error: COMPILER_WARNING (CWE-477): [#def180] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:144:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 144 | privkey = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL); # | ^~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:420:17: note: declared here # 420 | ssh_private_key privatekey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~ # 142| unlink(LIBSSH_RSA_TESTKEY ".pub"); # 143| # 144|-> privkey = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL); # 145| assert_non_null(privkey); # 146| Error: COMPILER_WARNING (CWE-477): [#def181] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:147:5: warning[-Wdeprecated-declarations]: ‘publickey_from_privatekey’ is deprecated # 147 | pubkey = publickey_from_privatekey(privkey); # | ^~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:379:16: note: declared here # 379 | ssh_public_key publickey_from_privatekey(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~~~~~~~~~~~ # 145| assert_non_null(privkey); # 146| # 147|-> pubkey = publickey_from_privatekey(privkey); # 148| assert_non_null(pubkey); # 149| type_new = privkey->type; Error: GCC_ANALYZER_WARNING (CWE-476): [#def182] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_generate_from_privkey’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:149:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ # 147| pubkey = publickey_from_privatekey(privkey); # 148| assert_non_null(pubkey); # 149|-> type_new = privkey->type; # 150| privatekey_free(privkey); # 151| Error: COMPILER_WARNING (CWE-477): [#def183] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:150:5: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 150 | privatekey_free(privkey); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:476:6: note: declared here # 476 | void privatekey_free(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~ # 148| assert_non_null(pubkey); # 149| type_new = privkey->type; # 150|-> privatekey_free(privkey); # 151| # 152| pubkey_new = publickey_to_string(pubkey); Error: COMPILER_WARNING (CWE-477): [#def184] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:152:5: warning[-Wdeprecated-declarations]: ‘publickey_to_string’ is deprecated # 152 | pubkey_new = publickey_to_string(pubkey); # | ^~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:565:12: note: declared here # 565 | ssh_string publickey_to_string(ssh_public_key pubkey) { # | ^~~~~~~~~~~~~~~~~~~ # 150| privatekey_free(privkey); # 151| # 152|-> pubkey_new = publickey_to_string(pubkey); # 153| publickey_free(pubkey); # 154| Error: COMPILER_WARNING (CWE-477): [#def185] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:153:5: warning[-Wdeprecated-declarations]: ‘publickey_free’ is deprecated # 153 | publickey_free(pubkey); # | ^~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:357:6: note: declared here # 357 | void publickey_free(ssh_public_key key) { # | ^~~~~~~~~~~~~~ # 151| # 152| pubkey_new = publickey_to_string(pubkey); # 153|-> publickey_free(pubkey); # 154| # 155| assert_non_null(pubkey_new); Error: COMPILER_WARNING (CWE-477): [#def186] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:162:5: warning[-Wdeprecated-declarations]: ‘ssh_publickey_to_file’ is deprecated # 162 | rc = ssh_publickey_to_file(session, LIBSSH_RSA_TESTKEY ".pub", pubkey_new, type_new); # | ^~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:607:5: note: declared here # 607 | int ssh_publickey_to_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~~ # 160| ssh_string_len(pubkey_orig)); # 161| # 162|-> rc = ssh_publickey_to_file(session, LIBSSH_RSA_TESTKEY ".pub", pubkey_new, type_new); # 163| assert_true(rc == 0); # 164| Error: COMPILER_WARNING (CWE-477): [#def187] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_privatekey_from_file’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:192:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 192 | key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:420:17: note: declared here # 420 | ssh_private_key privatekey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~ # 190| ssh_private_key key = NULL; # 191| # 192|-> key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL); # 193| assert_non_null(key); # 194| if (key != NULL) { Error: COMPILER_WARNING (CWE-477): [#def188] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:195:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 195 | privatekey_free(key); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:476:6: note: declared here # 476 | void privatekey_free(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~ # 193| assert_non_null(key); # 194| if (key != NULL) { # 195|-> privatekey_free(key); # 196| key = NULL; # 197| } Error: COMPILER_WARNING (CWE-477): [#def189] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:200:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 200 | key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:420:17: note: declared here # 420 | ssh_private_key privatekey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~ # 198| # 199| /* Test the automatic type discovery */ # 200|-> key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL); # 201| assert_non_null(key); # 202| if (key != NULL) { Error: COMPILER_WARNING (CWE-477): [#def190] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:203:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 203 | privatekey_free(key); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:476:6: note: declared here # 476 | void privatekey_free(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~ # 201| assert_non_null(key); # 202| if (key != NULL) { # 203|-> privatekey_free(key); # 204| key = NULL; # 205| } Error: COMPILER_WARNING (CWE-477): [#def191] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_privatekey_from_file_passphrase’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:216:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 216 | key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, TORTURE_TESTKEY_PASSWORD); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:420:17: note: declared here # 420 | ssh_private_key privatekey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~ # 214| ssh_private_key key = NULL; # 215| # 216|-> key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, TORTURE_TESTKEY_PASSWORD); # 217| assert_non_null(key); # 218| if (key != NULL) { Error: COMPILER_WARNING (CWE-477): [#def192] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:219:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 219 | privatekey_free(key); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:476:6: note: declared here # 476 | void privatekey_free(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~ # 217| assert_non_null(key); # 218| if (key != NULL) { # 219|-> privatekey_free(key); # 220| key = NULL; # 221| } Error: COMPILER_WARNING (CWE-477): [#def193] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:224:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated # 224 | key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, TORTURE_TESTKEY_PASSWORD); # | ^~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:420:17: note: declared here # 420 | ssh_private_key privatekey_from_file(ssh_session session, # | ^~~~~~~~~~~~~~~~~~~~ # 222| # 223| /* Test the automatic type discovery */ # 224|-> key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, TORTURE_TESTKEY_PASSWORD); # 225| assert_non_null(key); # 226| if (key != NULL) { Error: COMPILER_WARNING (CWE-477): [#def194] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_keyfiles.c:227:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated # 227 | privatekey_free(key); # | ^~~~~~~~~~~~~~~ libssh-0.11.1-build/libssh-0.11.1/src/legacy.c:476:6: note: declared here # 476 | void privatekey_free(ssh_private_key prv) { # | ^~~~~~~~~~~~~~~ # 225| assert_non_null(key); # 226| if (key != NULL) { # 227|-> privatekey_free(key); # 228| key = NULL; # 229| } Error: GCC_ANALYZER_WARNING (CWE-688): [#def195] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_moduli.c: scope_hint: In function ‘torture_retrieve_dhgroup_file’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_moduli.c:84:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘tmpfile()’ where non-null expected libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:27: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_moduli.c:5: included_from: Included from here. /usr/include/stdio.h:735:15: note: argument 4 of ‘fwrite’ must be non-null # 82| int rc; # 83| # 84|-> fwrite(moduli_content, 1, sizeof(moduli_content), moduli); # 85| rewind(moduli); # 86| rc = ssh_retrieve_dhgroup_file(moduli, Error: GCC_ANALYZER_WARNING (CWE-688): [#def196] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c: scope_hint: In function ‘torture_options_minus_sign’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:1664:5: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 1662| p = strstr(awaited, alg); # 1663| assert_non_null(p); # 1664|-> memmove(p, p+alg_len, strlen(p + alg_len) + 1); # 1665| # 1666| if (ssh_fips_mode()) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def197] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:1677:5: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 1675| p = strstr(awaited, algs); # 1676| assert_non_null(p); # 1677|-> memmove(p, p+algs_len, strlen(p + algs_len) + 1); # 1678| # 1679| if (ssh_fips_mode()) { Error: GCC_ANALYZER_WARNING (CWE-688): [#def198] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c: scope_hint: In function ‘torture_options_caret_sign’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:1730:9: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 1728| /* look for second occurrence */ # 1729| p = strstr(p+1, algs); # 1730|-> memmove(p, p+alg_len, strlen(p + alg_len) + 1); # 1731| } # 1732| Error: GCC_ANALYZER_WARNING (CWE-688): [#def199] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:1752:9: warning[-Wanalyzer-null-argument]: use of NULL ‘p’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_memmove’ must be non-null # 1750| /* look for second occurrence */ # 1751| p = strstr(p+1, algs); # 1752|-> memmove(p, p+algs_len, strlen(p + algs_len) + 1); # 1753| } # 1754| Error: GCC_ANALYZER_WARNING (CWE-401): [#def200] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c: scope_hint: In function ‘torture_options_apply’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:1935:1: warning[-Wanalyzer-malloc-leak]: leak of ‘id’ libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_options.c:11: included_from: Included from here. # 1933| # 1934| ssh_list_free(awaited_list); # 1935|-> } # 1936| # 1937| static void torture_options_set_verbosity (void **state) Error: GCC_ANALYZER_WARNING (CWE-476): [#def201] libssh-0.11.1-build/libssh-0.11.1/tests/torture.h:37: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:9: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:276:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘key’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/wrapper.h:28: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/pki.c:36: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:8: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:258:17: note: in expansion of macro ‘ssh_fips_mode’ # 274| assert_true(rc == SSH_OK); # 275| assert_non_null(key); # 276|-> assert_int_equal(key->type, sig_type); # 277| assert_string_equal(key->type_c, skey_attrs.type_c); # 278| bits = ssh_key_size(key); Error: GCC_ANALYZER_WARNING (CWE-476): [#def202] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:300:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:258:17: note: in expansion of macro ‘ssh_fips_mode’ libssh-0.11.1-build/libssh-0.11.1/include/libssh/session.h:25: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/pki.c:47: included_from: Included from here. libssh-0.11.1-build/libssh-0.11.1/src/pki.c:115:5: note: in expansion of macro ‘ZERO_STRUCTP’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’ # 298| sign = pki_do_sign(key, INPUT, input_length, hash); # 299| assert_non_null(sign); # 300|-> assert_int_equal(sign->type, key->type); # 301| assert_string_equal(sign->type_c, skey_attrs.sig_type_c); # 302| Error: GCC_ANALYZER_WARNING (CWE-476): [#def203] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:379:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pubkey’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:258:17: note: in expansion of macro ‘ssh_fips_mode’ libssh-0.11.1-build/libssh-0.11.1/src/pki.c:115:5: note: in expansion of macro ‘ZERO_STRUCTP’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:328:21: note: in expansion of macro ‘ssh_fips_mode’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:341:17: note: in expansion of macro ‘SSH_LOG’ libssh-0.11.1-build/libssh-0.11.1/src/pki.c:115:5: note: in expansion of macro ‘ZERO_STRUCTP’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’ # 377| sig_type, # 378| import_sig->hash_type); # 379|-> if (ssh_key_type_plain(verify_pubkey->type) == sig_type) { # 380| /* Importing with the same key type should work */ # 381| assert_non_null(new_sig); Error: GCC_ANALYZER_WARNING (CWE-476): [#def204] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:379:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘verify_key’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:258:17: note: in expansion of macro ‘ssh_fips_mode’ libssh-0.11.1-build/libssh-0.11.1/src/pki.c:115:5: note: in expansion of macro ‘ZERO_STRUCTP’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:328:21: note: in expansion of macro ‘ssh_fips_mode’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki.c:341:17: note: in expansion of macro ‘SSH_LOG’ # 377| sig_type, # 378| import_sig->hash_type); # 379|-> if (ssh_key_type_plain(verify_pubkey->type) == sig_type) { # 380| /* Importing with the same key type should work */ # 381| assert_non_null(new_sig); Error: COMPILER_WARNING (CWE-252): [#def205] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ecdsa_uri.c: scope_hint: In function ‘torture_pki_ecdsa_publickey_from_privatekey_uri’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ecdsa_uri.c:218:5: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’ # 218 | system(convert_key_to_pem); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~ # 216| pub_filename_generated, pub_filename_pem); # 217| # 218|-> system(convert_key_to_pem); # 219| # 220| rc = torture_read_one_line(pub_filename_pem, Error: GCC_ANALYZER_WARNING (CWE-688): [#def206] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_verify’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c:830:11: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘pkey_ptr’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null # 828| # 829| /* remove trailing comment */ # 830|-> ptr = strchr(pkey_ptr, ' '); # 831| if(ptr != NULL){ # 832| *ptr = '\0'; Error: GCC_ANALYZER_WARNING (CWE-688): [#def207] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_verify_bad’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c:885:11: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘pkey_ptr’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null # 883| # 884| /* remove trailing comment */ # 885|-> ptr = strchr(pkey_ptr, ' '); # 886| if(ptr != NULL){ # 887| *ptr = '\0'; Error: GCC_ANALYZER_WARNING (CWE-476): [#def208] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_pubkey_dup’ libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_pki_ed25519.c:992:8: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘q’ # 990| q = strchr(pub_str, ' '); # 991| assert_non_null(q); # 992|-> *q = '\0'; # 993| # 994| rc = ssh_pki_import_pubkey_base64(pub_str, Error: CPPCHECK_WARNING (CWE-476): [#def209] libssh-0.11.1-build/libssh-0.11.1/tests/unittests/torture_threads_buffer.c:133: warning[nullPointer]: Possible null pointer dereference: buffer # 131| ssh_buffer_get_u8(buffer,&c); # 132| ssh_buffer_add_data(buffer,"A",1); # 133|-> if (buffer->used >= 128) { # 134| if (ssh_buffer_get_len(buffer) * 4 < buffer->allocated) { # 135| assert_true(ssh_buffer_get_len(buffer) * 4 >= buffer->allocated);
analyzer-version-clippy | 1.82.0 |
analyzer-version-cppcheck | 2.16.0 |
analyzer-version-gcc | 14.2.1 |
analyzer-version-gcc-analyzer | 15.0.0 |
analyzer-version-shellcheck | 0.10.0 |
analyzer-version-unicontrol | 0.0.2 |
enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
exit-code | 0 |
host | ip-172-16-1-86.us-west-2.compute.internal |
mock-config | fedora-rawhide-gcc-latest-x86_64 |
project-name | libssh-0.11.1-1.fc42 |
store-results-to | /tmp/tmpxoq8qzff/libssh-0.11.1-1.fc42.tar.xz |
time-created | 2024-11-13 01:48:01 |
time-finished | 2024-11-13 01:55:05 |
tool | csmock |
tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'clippy,cppcheck,gcc,unicontrol,shellcheck' '-o' '/tmp/tmpxoq8qzff/libssh-0.11.1-1.fc42.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpxoq8qzff/libssh-0.11.1-1.fc42.src.rpm' |
tool-version | csmock-3.7.1.20241107.094801.gb3f0f26.pr_192-1.el9 |