libssh-0.10.6-6.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
libssh-0.10.6/examples/keygen2.c:371:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  369|   
#  370|       errno = 0;
#  371|->     rc = open(arguments.file, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR);
#  372|       if (rc < 0) {
#  373|           if (errno == EEXIST) {

Error: COMPILER_WARNING (CWE-477): [#def2]
libssh-0.10.6/examples/libssh_scp.c: scope_hint: In function ‘close_location’
libssh-0.10.6/examples/libssh_scp.c:156:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
libssh-0.10.6/examples/libssh_scp.c:22: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:563: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): [#def3]
libssh-0.10.6/examples/libssh_scp.c:162:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565: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): [#def4]
libssh-0.10.6/examples/libssh_scp.c: scope_hint: In function ‘open_location’
libssh-0.10.6/examples/libssh_scp.c:187:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:568: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): [#def5]
libssh-0.10.6/examples/libssh_scp.c:196:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:566: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): [#def6]
libssh-0.10.6/examples/libssh_scp.c:198:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565: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): [#def7]
libssh-0.10.6/examples/libssh_scp.c:213:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:568: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): [#def8]
libssh-0.10.6/examples/libssh_scp.c:222:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:566: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): [#def9]
libssh-0.10.6/examples/libssh_scp.c:224:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565: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): [#def10]
libssh-0.10.6/examples/libssh_scp.c: scope_hint: In function ‘open_location’
libssh-0.10.6/examples/libssh_scp.c:236:42: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*loc.path’ where non-null expected
libssh-0.10.6/examples/libssh_scp.c:19: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:63: included_from: Included from here.
/usr/include/unistd.h:517:12: note: argument 1 of ‘chdir’ must be non-null
#  234|           if (!loc->file) {
#  235|               if (errno == EISDIR) {
#  236|->                 if (loc->path != NULL && chdir(loc->path)) {
#  237|                       fprintf(stderr,
#  238|                               "Error changing directory to %s: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
libssh-0.10.6/examples/libssh_scp.c: scope_hint: In function ‘do_copy’
libssh-0.10.6/examples/libssh_scp.c:273:14: warning[-Wanalyzer-null-argument]: use of NULL ‘*src.file’ where non-null expected
libssh-0.10.6/examples/libssh_scp.c:16: included_from: Included from here.
/usr/include/stdio.h:883: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): [#def12]
libssh-0.10.6/examples/libssh_scp.c: scope_hint: In function ‘do_copy’
libssh-0.10.6/examples/libssh_scp.c:290:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:569: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): [#def13]
libssh-0.10.6/examples/libssh_scp.c:292:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_deny_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:564: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): [#def14]
libssh-0.10.6/examples/libssh_scp.c:296:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:576: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): [#def15]
libssh-0.10.6/examples/libssh_scp.c:297:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:574: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): [#def16]
libssh-0.10.6/examples/libssh_scp.c:298:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:575: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): [#def17]
libssh-0.10.6/examples/libssh_scp.c:313:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:571: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): [#def18]
libssh-0.10.6/examples/libssh_scp.c:320:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565: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): [#def19]
libssh-0.10.6/examples/libssh_scp.c:332:21: warning[-Wdeprecated-declarations]: ‘ssh_scp_deny_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:564: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): [#def20]
libssh-0.10.6/examples/libssh_scp.c:339:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:562:31: note: declared here
#  337|           }
#  338|           if (src->is_ssh) {
#  339|->             ssh_scp_accept_request(src->scp);
#  340|           }
#  341|       }

Error: COMPILER_WARNING (CWE-477): [#def21]
libssh-0.10.6/examples/libssh_scp.c:345:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:573: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): [#def22]
libssh-0.10.6/examples/libssh_scp.c:373:13: warning[-Wdeprecated-declarations]: ‘ssh_scp_write’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:579: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): [#def23]
libssh-0.10.6/examples/libssh_scp.c:378:17: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565: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): [#def24]
libssh-0.10.6/examples/samplesshd-kbdint.c: scope_hint: In function ‘authenticate’
libssh-0.10.6/examples/samplesshd-kbdint.c:240:32: warning[-Wdeprecated-declarations]: ‘ssh_message_auth_password’ is deprecated
libssh-0.10.6/examples/samplesshd-kbdint.c:18: included_from: Included from here.
libssh-0.10.6/include/libssh/server.h:302:39: note: declared here
#  238|                           printf("User %s wants to auth with pass %s\n",
#  239|                                  ssh_message_auth_user(message),
#  240|->                                ssh_message_auth_password(message));
#  241|                           if(auth_password(ssh_message_auth_user(message),
#  242|                              ssh_message_auth_password(message))){

Error: COMPILER_WARNING (CWE-477): [#def25]
libssh-0.10.6/examples/samplesshd-kbdint.c:242:28: warning[-Wdeprecated-declarations]: ‘ssh_message_auth_password’ is deprecated
libssh-0.10.6/include/libssh/server.h:302:39: note: declared here
#  240|                                  ssh_message_auth_password(message));
#  241|                           if(auth_password(ssh_message_auth_user(message),
#  242|->                            ssh_message_auth_password(message))){
#  243|                                  ssh_message_auth_reply_success(message,0);
#  244|                                  ssh_message_free(message);

Error: COMPILER_WARNING (CWE-477): [#def26]
libssh-0.10.6/examples/scp_download.c: scope_hint: In function ‘fetch_files’
libssh-0.10.6/examples/scp_download.c:113:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_new’ is deprecated
libssh-0.10.6/examples/scp_download.c:22: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:568:35: note: declared here
#  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): [#def27]
libssh-0.10.6/examples/scp_download.c:114:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  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): [#def28]
libssh-0.10.6/examples/scp_download.c:116:11: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  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): [#def29]
libssh-0.10.6/examples/scp_download.c:122:11: warning[-Wdeprecated-declarations]: ‘ssh_scp_pull_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:569:31: note: declared here
#  120|     do {
#  121|   
#  122|-> 	  r=ssh_scp_pull_request(scp);
#  123|   	  switch(r){
#  124|   	  case SSH_SCP_REQUEST_NEWFILE:

Error: COMPILER_WARNING (CWE-477): [#def30]
libssh-0.10.6/examples/scp_download.c:125:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_size’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:576:34: note: declared here
#  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): [#def31]
libssh-0.10.6/examples/scp_download.c:126:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:574:39: note: declared here
#  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): [#def32]
libssh-0.10.6/examples/scp_download.c:127:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:575:31: note: declared here
#  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): [#def33]
libssh-0.10.6/examples/scp_download.c:130:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:562:31: note: declared here
#  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): [#def34]
libssh-0.10.6/examples/scp_download.c:131:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_read’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:573:31: note: declared here
#  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): [#def35]
libssh-0.10.6/examples/scp_download.c:134:27: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  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): [#def36]
libssh-0.10.6/examples/scp_download.c:135:27: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  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): [#def37]
libssh-0.10.6/examples/scp_download.c:142:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  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): [#def38]
libssh-0.10.6/examples/scp_download.c:143:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  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): [#def39]
libssh-0.10.6/examples/scp_download.c:146:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_warning’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:578:39: note: declared here
#  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): [#def40]
libssh-0.10.6/examples/scp_download.c:149:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_filename’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:574:39: note: declared here
#  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): [#def41]
libssh-0.10.6/examples/scp_download.c:150:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_request_get_permissions’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:575:31: note: declared here
#  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): [#def42]
libssh-0.10.6/examples/scp_download.c:153:19: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:562:31: note: declared here
#  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): [#def43]
libssh-0.10.6/examples/scp_download.c:164:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  162|     } while (1);
#  163|     end:
#  164|->   ssh_scp_close(scp);
#  165|     ssh_scp_free(scp);
#  166|     return 0;

Error: COMPILER_WARNING (CWE-477): [#def44]
libssh-0.10.6/examples/scp_download.c:165:3: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  163|     end:
#  164|     ssh_scp_close(scp);
#  165|->   ssh_scp_free(scp);
#  166|     return 0;
#  167|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def45]
libssh-0.10.6/examples/ssh_X11_client.c: scope_hint: In function ‘insert_item’
libssh-0.10.6/examples/ssh_X11_client.c:279:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘node’
#  277|   		/* Calloc ensure that node is full of 0 */
#  278|   		node = (node_t *) calloc(1, sizeof(node_t));
#  279|-> 		node->channel = channel;
#  280|   		node->fd_in = fd_in;
#  281|   		node->fd_out = fd_out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
libssh-0.10.6/examples/ssh_X11_client.c:290:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new’
#  288|   		/* Create the new node */
#  289|   		new = (node_t *) malloc(sizeof(node_t));
#  290|-> 		new->channel = channel;
#  291|   		new->fd_in = fd_in;
#  292|   		new->fd_out = fd_out;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def47]
libssh-0.10.6/examples/ssh_X11_client.c: scope_hint: In function ‘copy_fd_to_channel_callback’
libssh-0.10.6/examples/ssh_X11_client.c:558:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  556|   	if (!channel) {
#  557|   		_ssh_log(SSH_LOG_FUNCTIONS, __func__, "channel does not exist.");
#  558|-> 		if (temp_node->protected == 0) {
#  559|   			close(fd);
#  560|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
libssh-0.10.6/examples/ssh_X11_client.c:582:38: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  580|   			/* sz = 0. Why the hell I'm here? */
#  581|   			_ssh_log(SSH_LOG_FUNCTIONS, __func__, "Why the hell am I here?: sz: %d", sz);
#  582|-> 			if (temp_node->protected == 0) {
#  583|   				close(fd);
#  584|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def49]
libssh-0.10.6/examples/ssh_X11_client.c: scope_hint: In function ‘copy_channel_to_fd_callback’
libssh-0.10.6/examples/ssh_X11_client.c:610:12: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  608|   	temp_node = search_item(channel);
#  609|   
#  610|-> 	fd = temp_node->fd_out;
#  611|   
#  612|   	_ssh_log(SSH_LOG_FUNCTIONS, __func__, "len: %d - fd: %d - is_stderr: %d", len, fd, is_stderr);

Error: GCC_ANALYZER_WARNING (CWE-479): [#def50]
libssh-0.10.6/examples/ssh_client.c: scope_hint: In function ‘do_exit’
libssh-0.10.6/examples/ssh_client.c:175:5: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
libssh-0.10.6/examples/ssh_client.c:175:5: note: ‘_exit’ is a possible signal-safe alternative for ‘exit’
#  173|   
#  174|       do_cleanup(0);
#  175|->     exit(0);
#  176|   }
#  177|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def51]
libssh-0.10.6/examples/sshd_direct-tcpip.c: scope_hint: In function ‘do_cleanup’
libssh-0.10.6/examples/sshd_direct-tcpip.c:45:30: warning[-Wanalyzer-deref-before-check]: check of ‘*current.data’ for NULL after already dereferencing it
libssh-0.10.6/examples/sshd_direct-tcpip.c:136:17: note: in expansion of macro ‘SAFE_FREE’
libssh-0.10.6/examples/sshd_direct-tcpip.c:134:17: note: in expansion of macro ‘SAFE_FREE’
libssh-0.10.6/examples/sshd_direct-tcpip.c:134:17: note: in expansion of macro ‘SAFE_FREE’
libssh-0.10.6/examples/sshd_direct-tcpip.c:135:17: note: in expansion of macro ‘SAFE_FREE’
libssh-0.10.6/examples/sshd_direct-tcpip.c:45:32: note: in definition of macro ‘SAFE_FREE’
libssh-0.10.6/examples/sshd_direct-tcpip.c:136: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-476): [#def52]
libssh-0.10.6/examples/sshd_direct-tcpip.c: scope_hint: In function ‘cleanup_push’
libssh-0.10.6/examples/sshd_direct-tcpip.c:99:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_node’
#   97|   
#   98|       if (*head_ref != NULL) {
#   99|->         new_node->next = *head_ref;
#  100|       } else {
#  101|           new_node->next = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
libssh-0.10.6/examples/sshd_direct-tcpip.c:101:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_node’
#   99|           new_node->next = *head_ref;
#  100|       } else {
#  101|->         new_node->next = NULL;
#  102|       }
#  103|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libssh-0.10.6/include/libssh/priv.h:173: included_from: Included from here.
libssh-0.10.6/src/gssapi.c: scope_hint: In function ‘ssh_packet_userauth_gssapi_response’
libssh-0.10.6/include/libssh/libssh.h:800:29: warning[-Wanalyzer-malloc-leak]: leak of ‘ssh_gssapi_oid_from_string(ssh_buffer_get_ssh_string(packet))’
libssh-0.10.6/src/gssapi.c:889:5: note: in expansion of macro ‘SSH_STRING_FREE’
libssh-0.10.6/include/libssh/callbacks.h:533:13: note: in definition of macro ‘SSH_PACKET_CALLBACK’
libssh-0.10.6/src/gssapi.c:889:5: note: in expansion of macro ‘SSH_STRING_FREE’
#  798|   LIBSSH_API int ssh_string_fill(ssh_string str, const void *data, size_t len);
#  799|   #define SSH_STRING_FREE(x) \
#  800|->     do { if ((x) != NULL) { ssh_string_free(x); x = NULL; } } while(0)
#  801|   LIBSSH_API void ssh_string_free(ssh_string str);
#  802|   LIBSSH_API ssh_string ssh_string_from_char(const char *what);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libssh-0.10.6/src/auth.c: scope_hint: In function ‘ssh_packet_userauth_info_request’
libssh-0.10.6/src/auth.c:1697:8: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)nprompts, 8)’
libssh-0.10.6/src/auth.c:38: included_from: Included from here.
libssh-0.10.6/include/libssh/buffer.h:64:70: note: in definition of macro ‘ssh_buffer_unpack’
libssh-0.10.6/src/auth.c:35: included_from: Included from here.
libssh-0.10.6/src/auth.c:1682:5: note: in expansion of macro ‘SSH_LOG’
# 1695|       session->kbdint->nanswers = nprompts;
# 1696|       session->kbdint->prompts = calloc(nprompts, sizeof(char *));
# 1697|->     if (session->kbdint->prompts == NULL) {
# 1698|           session->kbdint->nprompts = 0;
# 1699|           ssh_set_error_oom(session);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libssh-0.10.6/src/auth.c:1707:8: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)nprompts, 1)’
libssh-0.10.6/include/libssh/buffer.h:64:70: note: in definition of macro ‘ssh_buffer_unpack’
libssh-0.10.6/src/auth.c:1682:5: note: in expansion of macro ‘SSH_LOG’
# 1705|   
# 1706|       session->kbdint->echo = calloc(nprompts, sizeof(unsigned char));
# 1707|->     if (session->kbdint->echo == NULL) {
# 1708|           session->kbdint->nprompts = 0;
# 1709|           ssh_set_error_oom(session);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
libssh-0.10.6/src/bind.c: scope_hint: In function ‘ssh_bind_accept_fd’
libssh-0.10.6/src/bind.c:442:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sshbind.bindfd’
#  440|   
#  441|       /* Apply global bind configurations, if it hasn't been applied before */
#  442|->     rc = ssh_bind_options_parse_config(sshbind, NULL);
#  443|       if (rc != 0) {
#  444|           ssh_set_error(sshbind, SSH_FATAL,"Could not parse global config");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
libssh-0.10.6/src/bind.c: scope_hint: In function ‘ssh_bind_accept’
libssh-0.10.6/src/bind.c:598:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*sshbind.bindfd’
#  596|   
#  597|       fd = accept(sshbind->bindfd, NULL, NULL);
#  598|->     if (fd == SSH_INVALID_SOCKET) {
#  599|           char err_msg[SSH_ERRNO_MSG_MAX] = {0};
#  600|           if (errno == EINTR) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libssh-0.10.6/tests/unittests/torture_buffer.c:7: included_from: Included from here.
libssh-0.10.6/src/buffer.c: scope_hint: In function ‘realloc_buffer’
libssh-0.10.6/src/buffer.c:106:8: warning[-Wanalyzer-malloc-leak]: leak of ‘new’
libssh-0.10.6/src/buffer.c:37: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_buffer.c:242:10: note: in expansion of macro ‘ssh_buffer_pack’
libssh-0.10.6/tests/unittests/torture_buffer.c:242:10: note: in expansion of macro ‘ssh_buffer_pack’
libssh-0.10.6/tests/unittests/torture_buffer.c:247:10: note: in expansion of macro ‘ssh_buffer_pack’
libssh-0.10.6/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.10.6/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’
libssh-0.10.6/src/buffer.c:1226:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
libssh-0.10.6/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’
libssh-0.10.6/src/buffer.c: scope_hint: In function ‘ssh_buffer_unpack_va’
# 1224|               }
# 1225|   
# 1226|->             o.data = va_arg(ap, void **);
# 1227|               count++;
# 1228|   

Error: CLANG_WARNING: [#def61]
libssh-0.10.6/src/dh.c:741:17: warning[deadcode.DeadStores]: Value stored to 'prefix' during its initialization is never read
#  739|                                  size_t len)
#  740|   {
#  741|->     const char *prefix = "UNKNOWN";
#  742|       char *fingerprint = NULL;
#  743|       char *str = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def62]
libssh-0.10.6/src/ecdh_crypto.c: scope_hint: In function ‘ecdh_build_k’
libssh-0.10.6/src/ecdh_crypto.c:302:15: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libssh-0.10.6/src/ecdh_crypto.c: scope_hint: In function ‘ecdh_build_k’
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  300|                                                   ssh_string_len(peer_pubkey));
#  301|     curve = ecdh_kex_type_to_curve(next_crypto->kex_type);
#  302|->   params[1] = OSSL_PARAM_construct_utf8_string(OSSL_PKEY_PARAM_GROUP_NAME,
#  303|                                                  (char *)curve,
#  304|                                                  strlen(curve));

Error: CLANG_WARNING: [#def63]
libssh-0.10.6/src/ecdh_crypto.c:337:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'secret'
#  335|     rc = EVP_PKEY_derive(dh_ctx, secret, &secret_len);
#  336|     if (rc != 1) {
#  337|->       EVP_PKEY_CTX_free(dh_ctx);
#  338|         return -1;
#  339|     }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def64]
libssh-0.10.6/src/external/chacha.c: scope_hint: In function ‘chacha_encrypt_bytes’
libssh-0.10.6/src/external/chacha.c:206:54: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ctarget’
libssh-0.10.6/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): [#def65]
libssh-0.10.6/src/gssapi.c: scope_hint: In function ‘ssh_packet_userauth_gssapi_token_server’
libssh-0.10.6/src/gssapi.c:180:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ssh_gssapi_name_to_char(client_name)’
libssh-0.10.6/include/libssh/priv.h:174: included_from: Included from here.
libssh-0.10.6/include/libssh/session.h:25: included_from: Included from here.
libssh-0.10.6/include/libssh/gssapi.h:25: included_from: Included from here.
libssh-0.10.6/src/gssapi.c:32: included_from: Included from here.
libssh-0.10.6/include/libssh/callbacks.h:533:13: note: in definition of macro ‘SSH_PACKET_CALLBACK’
libssh-0.10.6/include/libssh/callbacks.h:439:4: note: in definition of macro ‘ssh_callbacks_exists’
#  178|           gss_release_buffer(&dummy_min, &msg_maj);
#  179|       }
#  180|->     if (msg_min.value) {
#  181|           gss_release_buffer(&dummy_min, &msg_min);
#  182|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
libssh-0.10.6/src/kex.c: scope_hint: In function ‘ssh_kex_select_methods’
libssh-0.10.6/src/kex.c:987:40: warning[-Wanalyzer-malloc-leak]: leak of ‘*crypto.kex_methods[i]’
#  985|               if (aead_hmac) {
#  986|                   free(crypto->kex_methods[i]);
#  987|->                 crypto->kex_methods[i] = strdup(aead_hmac);
#  988|               }
#  989|           }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
libssh-0.10.6/src/kex.c:998:36: warning[-Wanalyzer-malloc-leak]: leak of ‘*crypto.kex_methods[i]’
#  996|           } else if ((i >= SSH_LANG_C_S) && (crypto->kex_methods[i] == NULL)) {
#  997|               /* we can safely do that for languages */
#  998|->             crypto->kex_methods[i] = strdup("");
#  999|           }
# 1000|       }

Error: COMPILER_WARNING (CWE-477): [#def68]
libssh-0.10.6/src/legacy.c: scope_hint: In function ‘ssh_userauth_privatekey_file’
libssh-0.10.6/src/legacy.c:128:3: warning[-Wdeprecated-declarations]: ‘publickey_from_file’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:847: included_from: Included from here.
libssh-0.10.6/include/libssh/priv.h:173: included_from: Included from here.
libssh-0.10.6/src/legacy.c:32: included_from: Included from here.
libssh-0.10.6/include/libssh/legacy.h:101:38: note: declared here
#  126|     snprintf(pubkeyfile, klen, "%s.pub", filename);
#  127|   
#  128|->   pubkey = publickey_from_file(session, pubkeyfile, &type);
#  129|     if (pubkey == NULL) {
#  130|       SSH_LOG(SSH_LOG_RARE, "Public key file %s not found. Trying to generate it.", pubkeyfile);

Error: COMPILER_WARNING (CWE-477): [#def69]
libssh-0.10.6/src/legacy.c:132:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
libssh-0.10.6/include/libssh/legacy.h:96:43: note: declared here
#  130|       SSH_LOG(SSH_LOG_RARE, "Public key file %s not found. Trying to generate it.", pubkeyfile);
#  131|       /* auto-detect the key type with type=0 */
#  132|->     privkey = privatekey_from_file(session, filename, 0, passphrase);
#  133|     } else {
#  134|       SSH_LOG(SSH_LOG_RARE, "Public key file %s loaded.", pubkeyfile);

Error: COMPILER_WARNING (CWE-477): [#def70]
libssh-0.10.6/src/legacy.c:135:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
libssh-0.10.6/include/libssh/legacy.h:96:43: note: declared here
#  133|     } else {
#  134|       SSH_LOG(SSH_LOG_RARE, "Public key file %s loaded.", pubkeyfile);
#  135|->     privkey = privatekey_from_file(session, filename, type, passphrase);
#  136|     }
#  137|     if (privkey == NULL) {

Error: COMPILER_WARNING (CWE-477): [#def71]
libssh-0.10.6/src/legacy.c:142:3: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
libssh-0.10.6/include/libssh/legacy.h:95:32: note: declared here
#  140|     /* ssh_userauth_pubkey is responsible for taking care of null-pubkey */
#  141|     rc = ssh_userauth_pubkey(session, username, pubkey, privkey);
#  142|->   privatekey_free(privkey);
#  143|   
#  144|   error:

Error: COMPILER_WARNING (CWE-477): [#def72]
libssh-0.10.6/src/legacy.c: scope_hint: In function ‘channel_select’
libssh-0.10.6/src/legacy.c:294:3: warning[-Wdeprecated-declarations]: ‘ssh_channel_select’ is deprecated
libssh-0.10.6/include/libssh/libssh.h:559:31: note: declared here
#  292|   int channel_select(ssh_channel *readchans, ssh_channel *writechans, ssh_channel *exceptchans, struct
#  293|       timeval * timeout){
#  294|->   return ssh_channel_select(readchans, writechans, exceptchans, timeout);
#  295|   }
#  296|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def73]
libssh-0.10.6/src/legacy.c: scope_hint: In function ‘publickey_from_privatekey’
libssh-0.10.6/src/legacy.c:395:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘prv’
#  393|       }
#  394|   
#  395|->     privkey->type = prv->type;
#  396|       privkey->type_c = ssh_key_type_to_char(privkey->type);
#  397|       privkey->flags = SSH_KEY_FLAG_PRIVATE | SSH_KEY_FLAG_PUBLIC;

Error: COMPILER_WARNING (CWE-477): [#def74]
libssh-0.10.6/src/legacy.c: scope_hint: In function ‘ssh_try_publickey_from_file’
libssh-0.10.6/src/legacy.c:728:5: warning[-Wdeprecated-declarations]: ‘publickey_from_file’ is deprecated
libssh-0.10.6/src/legacy.c:498:12: note: declared here
#  726|        * the public as a string, and the private filename as an argument
#  727|        */
#  728|->     pubkey_string = publickey_from_file(session, pubkey_file, &pubkey_type);
#  729|       if (pubkey_string == NULL) {
#  730|           SSH_LOG(SSH_LOG_PACKET,

Error: CLANG_WARNING: [#def75]
libssh-0.10.6/src/messages.c:1131:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'msg'
# 1129|     ssh_message_queue(session,msg);
# 1130|   
# 1131|->   return SSH_PACKET_USED;
# 1132|   
# 1133|   error:

Error: CLANG_WARNING: [#def76]
libssh-0.10.6/src/messages.c:1449:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'msg'
# 1447|     ssh_message_queue(session,msg);
# 1448|   
# 1449|->   return SSH_OK;
# 1450|   error:
# 1451|     SSH_MESSAGE_FREE(msg);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def77]
libssh-0.10.6/src/misc.c: scope_hint: In function ‘ssh_path_expand_tilde.part.0’
libssh-0.10.6/src/misc.c:1137: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
# 1135|               return NULL;
# 1136|           }
# 1137|->         ld = strlen(p);
# 1138|           h = strdup(pw->pw_dir);
# 1139|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libssh-0.10.6/src/options.c: scope_hint: In function ‘ssh_options_copy’
libssh-0.10.6/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: CLANG_WARNING: [#def79]
libssh-0.10.6/src/options.c:128:18: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
#  126|               }
#  127|   
#  128|->             rc = ssh_list_append(list, id);
#  129|               if (rc < 0) {
#  130|                   free(id);

Error: CLANG_WARNING: [#def80]
libssh-0.10.6/src/options.c:1090:12: warning[unix.Malloc]: Potential leak of memory pointed to by 'q'
# 1088|       }
# 1089|   
# 1090|->     return 0;
# 1091|   }
# 1092|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def81]
libssh-0.10.6/src/packet.c: scope_hint: In function ‘packet_send2’
libssh-0.10.6/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: CLANG_WARNING: [#def82]
libssh-0.10.6/src/poll.c:551:13: warning[unix.Malloc]: Use of memory after it is freed
#  549|                * ctx->polls_used
#  550|                */
#  551|->             ssh_poll_free(p);
#  552|           }
#  553|   

Error: CLANG_WARNING: [#def83]
libssh-0.10.6/src/poll.c:1042:17: warning[unix.Malloc]: Use of memory after it is freed
# 1040|           if(fd == event->ctx->pollfds[i].fd) {
# 1041|               ssh_poll_handle p = event->ctx->pollptrs[i];
# 1042|->             if (p->session != NULL){
# 1043|               	/* we cannot free that handle, it's owned by its session */
# 1044|               	continue;

Error: COMPILER_WARNING (CWE-477): [#def84]
libssh-0.10.6/src/scp.c: scope_hint: In function ‘ssh_scp_new’
libssh-0.10.6/src/scp.c:110:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
libssh-0.10.6/include/libssh/priv.h:173: included_from: Included from here.
libssh-0.10.6/src/scp.c:30: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  108|   
#  109|   error:
#  110|->     ssh_scp_free(scp);
#  111|       return NULL;
#  112|   }

Error: COMPILER_WARNING (CWE-477): [#def85]
libssh-0.10.6/src/scp.c: scope_hint: In function ‘ssh_scp_free’
libssh-0.10.6/src/scp.c:303:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
libssh-0.10.6/src/scp.c:249:5: note: declared here
#  301|   
#  302|       if (scp->state != SSH_SCP_NEW) {
#  303|->         ssh_scp_close(scp);
#  304|       }
#  305|   

Error: COMPILER_WARNING (CWE-477): [#def86]
libssh-0.10.6/src/scp.c: scope_hint: In function ‘ssh_scp_push_file’
libssh-0.10.6/src/scp.c:577:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_push_file64’ is deprecated
libssh-0.10.6/src/scp.c:472:5: note: declared here
#  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): [#def87]
libssh-0.10.6/src/scp.c: scope_hint: In function ‘ssh_scp_read’
libssh-0.10.6/src/scp.c:1009:9: warning[-Wdeprecated-declarations]: ‘ssh_scp_accept_request’ is deprecated
libssh-0.10.6/src/scp.c:955:5: note: declared here
# 1007|           scp->request_type == SSH_SCP_REQUEST_NEWFILE)
# 1008|       {
# 1009|->         rc = ssh_scp_accept_request(scp);
# 1010|           if (rc == SSH_ERROR) {
# 1011|               return rc;

Error: CLANG_WARNING: [#def88]
libssh-0.10.6/src/session.c:143:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
#  141|           goto err;
#  142|       }
#  143|->     rc = ssh_list_append(session->opts.identity_non_exp, id);
#  144|       if (rc == SSH_ERROR) {
#  145|           goto err;

Error: CLANG_WARNING: [#def89]
libssh-0.10.6/src/session.c:153:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
#  151|           goto err;
#  152|       }
#  153|->     rc = ssh_list_append(session->opts.identity_non_exp, id);
#  154|       if (rc == SSH_ERROR) {
#  155|           goto err;

Error: CLANG_WARNING: [#def90]
libssh-0.10.6/src/session.c:170:30: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
#  168|   
#  169|       /* Explicitly initialize states */
#  170|->     session->session_state = SSH_SESSION_STATE_NONE;
#  171|       session->pending_call_state = SSH_PENDING_CALL_NONE;
#  172|       session->packet_state = PACKET_STATE_INIT;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
libssh-0.10.6/src/session.c: scope_hint: In function ‘ssh_new’
libssh-0.10.6/src/session.c:177:33: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
#  175|   
#  176|       session->auth.state = SSH_AUTH_STATE_NONE;
#  177|->     session->auth.service_state = SSH_AUTH_SERVICE_NONE;
#  178|   
#  179|       return session;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def92]
libssh-0.10.6/tests/client/torture_sftp_read.c:6: included_from: Included from here.
libssh-0.10.6/src/sftp.c: scope_hint: In function ‘sftp_read’
libssh-0.10.6/src/sftp.c:1920:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘handle’
# 1918|   /* Read from a file using an opened sftp file handle. */
# 1919|   ssize_t sftp_read(sftp_file handle, void *buf, size_t count) {
# 1920|->   sftp_session sftp = handle->sftp;
# 1921|     sftp_message msg = NULL;
# 1922|     sftp_status_message status;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
libssh-0.10.6/tests/client/torture_sftp_fsync.c:6: included_from: Included from here.
libssh-0.10.6/src/sftp.c: scope_hint: In function ‘sftp_write’
libssh-0.10.6/src/sftp.c:2150:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘file’
# 2148|   
# 2149|   ssize_t sftp_write(sftp_file file, const void *buf, size_t count) {
# 2150|->   sftp_session sftp = file->sftp;
# 2151|     sftp_message msg = NULL;
# 2152|     sftp_status_message status;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
libssh-0.10.6/src/socket.c: scope_hint: In function ‘ssh_execute_command’
libssh-0.10.6/src/socket.c:942:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 1)’
#  940|       /* Ignore anything on the stderr */
#  941|       dup2(devnull, STDERR_FILENO);
#  942|->     close(in);
#  943|       close(out);
#  944|       rc = execv(args[0], (char * const *)args);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def95]
libssh-0.10.6/src/socket.c:943:5: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘out’
libssh-0.10.6/src/socket.c:60: included_from: Included from here.
libssh-0.10.6/src/socket.c:981:5: note: in expansion of macro ‘SSH_LOG’
#  941|       dup2(devnull, STDERR_FILENO);
#  942|       close(in);
#  943|->     close(out);
#  944|       rc = execv(args[0], (char * const *)args);
#  945|       if (rc < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
libssh-0.10.6/src/wrapper.c: scope_hint: In function ‘crypt_set_algorithms2’
libssh-0.10.6/src/wrapper.c:296:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’
libssh-0.10.6/src/wrapper.c:45: included_from: Included from here.
libssh-0.10.6/src/wrapper.c:293:5: note: in expansion of macro ‘SSH_LOG’
#  294|   
#  295|       session->next_crypto->out_cipher = cipher_new(i);
#  296|->     if (session->next_crypto->out_cipher == NULL) {
#  297|           ssh_set_error_oom(session);
#  298|           return SSH_ERROR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
libssh-0.10.6/src/wrapper.c:355:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’
libssh-0.10.6/src/wrapper.c:293:5: note: in expansion of macro ‘SSH_LOG’
libssh-0.10.6/src/wrapper.c:331:5: note: in expansion of macro ‘SSH_LOG’
libssh-0.10.6/src/wrapper.c:352:5: note: in expansion of macro ‘SSH_LOG’
#  353|   
#  354|       session->next_crypto->in_cipher = cipher_new(i);
#  355|->     if (session->next_crypto->in_cipher == NULL) {
#  356|           ssh_set_error_oom(session);
#  357|           return SSH_ERROR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
libssh-0.10.6/src/wrapper.c: scope_hint: In function ‘crypt_set_algorithms_server’
libssh-0.10.6/src/wrapper.c:457:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’
libssh-0.10.6/src/wrapper.c:454:5: note: in expansion of macro ‘SSH_LOG’
#  455|   
#  456|       session->next_crypto->out_cipher = cipher_new(i);
#  457|->     if (session->next_crypto->out_cipher == NULL) {
#  458|           ssh_set_error_oom(session);
#  459|           return SSH_ERROR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
libssh-0.10.6/src/wrapper.c:512:16: warning[-Wanalyzer-malloc-leak]: leak of ‘cipher_new((int)i)’
libssh-0.10.6/src/wrapper.c:454:5: note: in expansion of macro ‘SSH_LOG’
libssh-0.10.6/src/wrapper.c:489:5: note: in expansion of macro ‘SSH_LOG’
libssh-0.10.6/src/wrapper.c:509:5: note: in expansion of macro ‘SSH_LOG’
#  510|   
#  511|       session->next_crypto->in_cipher = cipher_new(i);
#  512|->     if (session->next_crypto->in_cipher == NULL) {
#  513|           ssh_set_error_oom(session);
#  514|           return SSH_ERROR;

Error: CLANG_WARNING: [#def100]
libssh-0.10.6/tests/client/torture_auth.c:206:5: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  204|       assert_return_code(rc, errno);
#  205|   
#  206|->     unlink(ssh_agent_pidfile);
#  207|   
#  208|       unsetenv("TORTURE_SSH_AGENT_PIDFILE");

Error: GCC_ANALYZER_WARNING: [#def101]
libssh-0.10.6/tests/client/torture_connect.c: scope_hint: In function ‘torture_connect_socket’
libssh-0.10.6/tests/client/torture_connect.c:197:10: warning[-Wanalyzer-fd-use-without-check]: ‘connect’ on possibly invalid file descriptor ‘sock_fd’
#  195|       assert_true(sock_fd > 2);
#  196|   
#  197|->     rc = connect(sock_fd, (struct sockaddr *)&server_addr, sizeof(server_addr));
#  198|       assert_return_code(rc, errno);
#  199|   

Error: COMPILER_WARNING (CWE-477): [#def102]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload’
libssh-0.10.6/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.10.6/include/libssh/priv.h:173: included_from: Included from here.
libssh-0.10.6/tests/torture.h:33: included_from: Included from here.
libssh-0.10.6/tests/client/torture_scp.c:28: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def103]
libssh-0.10.6/tests/client/torture_scp.c:191:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  191 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def104]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:571:31: note: declared here
#  571 | 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): [#def105]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:579:31: note: declared here
#  579 | 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): [#def106]
libssh-0.10.6/tests/client/torture_scp.c:206:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  206 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def107]
libssh-0.10.6/tests/client/torture_scp.c:207:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  207 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def108]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_recursive’
libssh-0.10.6/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.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def109]
libssh-0.10.6/tests/client/torture_scp.c:256:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  256 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def110]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:570:31: note: declared here
#  570 | 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): [#def111]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:571:31: note: declared here
#  571 | 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): [#def112]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:579:31: note: declared here
#  579 | 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): [#def113]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:567:31: note: declared here
#  567 | 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): [#def114]
libssh-0.10.6/tests/client/torture_scp.c:278:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  278 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def115]
libssh-0.10.6/tests/client/torture_scp.c:279:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  279 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def116]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_download’
libssh-0.10.6/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.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def117]
libssh-0.10.6/tests/client/torture_scp.c:351:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  351 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def118]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:569:31: note: declared here
#  569 | 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): [#def119]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:576:34: note: declared here
#  576 | 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): [#def120]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:575:31: note: declared here
#  575 | 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): [#def121]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:574:39: note: declared here
#  574 | 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): [#def122]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:562:31: note: declared here
#  562 | 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): [#def123]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:573:31: note: declared here
#  573 | 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): [#def124]
libssh-0.10.6/tests/client/torture_scp.c:376:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  376 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def125]
libssh-0.10.6/tests/client/torture_scp.c:377:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  377 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def126]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_download_recursive’
libssh-0.10.6/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.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def127]
libssh-0.10.6/tests/client/torture_scp.c:431:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  431 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def128]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:569:31: note: declared here
#  569 | 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): [#def129]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:575:31: note: declared here
#  575 | 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): [#def130]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:574:39: note: declared here
#  574 | 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): [#def131]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:562:31: note: declared here
#  562 | 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): [#def132]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:569:31: note: declared here
#  569 | 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): [#def133]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:576:34: note: declared here
#  576 | 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): [#def134]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:575:31: note: declared here
#  575 | 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): [#def135]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:574:39: note: declared here
#  574 | 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): [#def136]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:562:31: note: declared here
#  562 | 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): [#def137]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:573:31: note: declared here
#  573 | 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): [#def138]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:569:31: note: declared here
#  569 | 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): [#def139]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:569:31: note: declared here
#  569 | 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): [#def140]
libssh-0.10.6/tests/client/torture_scp.c:480:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  480 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def141]
libssh-0.10.6/tests/client/torture_scp.c:481:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  481 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def142]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_newline’
libssh-0.10.6/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.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def143]
libssh-0.10.6/tests/client/torture_scp.c:517:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  517 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def144]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:570:31: note: declared here
#  570 | 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): [#def145]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:571:31: note: declared here
#  571 | 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): [#def146]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:579:31: note: declared here
#  579 | 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): [#def147]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:567:31: note: declared here
#  567 | 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): [#def148]
libssh-0.10.6/tests/client/torture_scp.c:536:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  536 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def149]
libssh-0.10.6/tests/client/torture_scp.c:537:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  537 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def150]
libssh-0.10.6/tests/client/torture_scp.c: scope_hint: In function ‘torture_scp_upload_appended_command’
libssh-0.10.6/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.10.6/include/libssh/libssh.h:568:35: note: declared here
#  568 | 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): [#def151]
libssh-0.10.6/tests/client/torture_scp.c:591:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_init’ is deprecated
#  591 |     rc = ssh_scp_init(scp);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:566:31: note: declared here
#  566 | 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): [#def152]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:570:31: note: declared here
#  570 | 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): [#def153]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:571:31: note: declared here
#  571 | 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): [#def154]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:579:31: note: declared here
#  579 | 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): [#def155]
libssh-0.10.6/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.10.6/include/libssh/libssh.h:567:31: note: declared here
#  567 | 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): [#def156]
libssh-0.10.6/tests/client/torture_scp.c:610:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_close’ is deprecated
#  610 |     ssh_scp_close(scp);
#      |     ^~~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:563:31: note: declared here
#  563 | 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): [#def157]
libssh-0.10.6/tests/client/torture_scp.c:611:5: warning[-Wdeprecated-declarations]: ‘ssh_scp_free’ is deprecated
#  611 |     ssh_scp_free(scp);
#      |     ^~~~~~~~~~~~
libssh-0.10.6/include/libssh/libssh.h:565:32: note: declared here
#  565 | 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): [#def158]
libssh-0.10.6/tests/client/torture_session.c: scope_hint: In function ‘torture_pubkey_hash’
libssh-0.10.6/tests/client/torture_session.c:403:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated
#  403 |     rc = ssh_get_pubkey_hash(session, NULL);
#      |     ^~
libssh-0.10.6/include/libssh/priv.h:173: included_from: Included from here.
libssh-0.10.6/tests/torture.h:33: included_from: Included from here.
libssh-0.10.6/tests/client/torture_session.c:26: included_from: Included from here.
libssh-0.10.6/include/libssh/libssh.h:550:31: note: declared here
#  550 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
#      |                               ^~~~~~~~~~~~~~~~~~~
#  401|   
#  402|       /* bad arguments */
#  403|->     rc = ssh_get_pubkey_hash(session, NULL);
#  404|       assert_int_equal(rc, SSH_ERROR);
#  405|   

Error: COMPILER_WARNING (CWE-477): [#def159]
libssh-0.10.6/tests/client/torture_session.c:406:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated
#  406 |     rc = ssh_get_pubkey_hash(NULL, (unsigned char **)&hash);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:550:31: note: declared here
#  550 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
#      |                               ^~~~~~~~~~~~~~~~~~~
#  404|       assert_int_equal(rc, SSH_ERROR);
#  405|   
#  406|->     rc = ssh_get_pubkey_hash(NULL, (unsigned char **)&hash);
#  407|       assert_int_equal(rc, SSH_ERROR);
#  408|   

Error: COMPILER_WARNING (CWE-477): [#def160]
libssh-0.10.6/tests/client/torture_session.c:410:5: warning[-Wdeprecated-declarations]: ‘ssh_get_pubkey_hash’ is deprecated
#  410 |     rc = ssh_get_pubkey_hash(session, (unsigned char **)&hash);
#      |     ^~
libssh-0.10.6/include/libssh/libssh.h:550:31: note: declared here
#  550 | SSH_DEPRECATED LIBSSH_API int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash);
#      |                               ^~~~~~~~~~~~~~~~~~~
#  408|   
#  409|       /* deprecated, but should be covered by tests! */
#  410|->     rc = ssh_get_pubkey_hash(session, (unsigned char **)&hash);
#  411|       if (ssh_fips_mode()) {
#  412|           /* When in FIPS mode, expect the call to fail */

Error: COMPILER_WARNING (CWE-563): [#def161]
libssh-0.10.6/tests/torture.c: scope_hint: In function ‘torture_setup_tokens’
libssh-0.10.6/tests/torture.c:1242:10: warning[-Wunused-variable]: unused variable ‘conf_path’
# 1242 |     char conf_path[1024] = {0};
#      |          ^~~~~~~~~
# 1240|       char token_setup_start_cmd[1024] = {0};
# 1241|       char socket_path[1204] = {0};
# 1242|->     char conf_path[1024] = {0};
# 1243|       int rc;
# 1244|   

Error: COMPILER_WARNING (CWE-563): [#def162]
libssh-0.10.6/tests/torture.c:1286:9: warning[-Wunused-variable]: unused variable ‘rc’
# 1286 |     int rc;
#      |         ^~
# 1284|   {
# 1285|       char pidfile[1024] = {0};
# 1286|->     int rc;
# 1287|       pid_t pid;
# 1288|   

Error: COMPILER_WARNING (CWE-563): [#def163]
libssh-0.10.6/tests/torture.c: scope_hint: In function ‘torture_cleanup_tokens’
libssh-0.10.6/tests/torture.c:1287:11: warning[-Wunused-variable]: unused variable ‘pid’
# 1287 |     pid_t pid;
#      |           ^~~
# 1285|       char pidfile[1024] = {0};
# 1286|       int rc;
# 1287|->     pid_t pid;
# 1288|   
# 1289|   #ifdef WITH_PKCS11_PROVIDER

Error: COMPILER_WARNING (CWE-477): [#def164]
libssh-0.10.6/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_from_file’
libssh-0.10.6/tests/unittests/torture_keyfiles.c:110:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated
#  110 |     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#      |     ^~
libssh-0.10.6/src/legacy.c:681:5: note: declared here
#  681 | int ssh_try_publickey_from_file(ssh_session session,
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  108|       int type, rc;
#  109|   
#  110|->     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#  111|   
#  112|       assert_true(rc == 0);

Error: COMPILER_WARNING (CWE-477): [#def165]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:119:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated
#  119 |     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#      |     ^~
libssh-0.10.6/src/legacy.c:681:5: note: declared here
#  681 | int ssh_try_publickey_from_file(ssh_session session,
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  117|       unlink(LIBSSH_RSA_TESTKEY ".pub");
#  118|   
#  119|->     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#  120|       assert_true(rc == 1);
#  121|   

Error: COMPILER_WARNING (CWE-477): [#def166]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:128:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated
#  128 |     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#      |     ^~
libssh-0.10.6/src/legacy.c:681:5: note: declared here
#  681 | int ssh_try_publickey_from_file(ssh_session session,
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  126|       unlink(LIBSSH_RSA_TESTKEY);
#  127|   
#  128|->     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey, &type);
#  129|       assert_true(rc == -1);
#  130|   

Error: COMPILER_WARNING (CWE-477): [#def167]
libssh-0.10.6/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_generate_from_privkey’
libssh-0.10.6/tests/unittests/torture_keyfiles.c:171:5: warning[-Wdeprecated-declarations]: ‘ssh_try_publickey_from_file’ is deprecated
#  171 |     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey_orig,
#      |     ^~
libssh-0.10.6/src/legacy.c:681:5: note: declared here
#  681 | int ssh_try_publickey_from_file(ssh_session session,
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  169|   
#  170|       /* read the publickey */
#  171|->     rc = ssh_try_publickey_from_file(session, LIBSSH_RSA_TESTKEY, &pubkey_orig,
#  172|           &type_orig);
#  173|       assert_true(rc == 0);

Error: COMPILER_WARNING (CWE-477): [#def168]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:183:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
#  183 |     privkey = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
#      |     ^~~~~~~
libssh-0.10.6/src/legacy.c:423:17: note: declared here
#  423 | ssh_private_key privatekey_from_file(ssh_session session,
#      |                 ^~~~~~~~~~~~~~~~~~~~
#  181|       unlink(LIBSSH_RSA_TESTKEY ".pub");
#  182|   
#  183|->     privkey = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
#  184|       assert_non_null(privkey);
#  185|   

Error: COMPILER_WARNING (CWE-477): [#def169]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:186:5: warning[-Wdeprecated-declarations]: ‘publickey_from_privatekey’ is deprecated
#  186 |     pubkey = publickey_from_privatekey(privkey);
#      |     ^~~~~~
libssh-0.10.6/src/legacy.c:384:16: note: declared here
#  384 | ssh_public_key publickey_from_privatekey(ssh_private_key prv) {
#      |                ^~~~~~~~~~~~~~~~~~~~~~~~~
#  184|       assert_non_null(privkey);
#  185|   
#  186|->     pubkey = publickey_from_privatekey(privkey);
#  187|       assert_non_null(pubkey);
#  188|       type_new = privkey->type;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
libssh-0.10.6/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_pubkey_generate_from_privkey’
libssh-0.10.6/tests/unittests/torture_keyfiles.c:188:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
#  186|       pubkey = publickey_from_privatekey(privkey);
#  187|       assert_non_null(pubkey);
#  188|->     type_new = privkey->type;
#  189|       privatekey_free(privkey);
#  190|   

Error: COMPILER_WARNING (CWE-477): [#def171]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:189:5: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
#  189 |     privatekey_free(privkey);
#      |     ^~~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:480:6: note: declared here
#  480 | void privatekey_free(ssh_private_key prv) {
#      |      ^~~~~~~~~~~~~~~
#  187|       assert_non_null(pubkey);
#  188|       type_new = privkey->type;
#  189|->     privatekey_free(privkey);
#  190|   
#  191|       pubkey_new = publickey_to_string(pubkey);

Error: COMPILER_WARNING (CWE-477): [#def172]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:191:5: warning[-Wdeprecated-declarations]: ‘publickey_to_string’ is deprecated
#  191 |     pubkey_new = publickey_to_string(pubkey);
#      |     ^~~~~~~~~~
libssh-0.10.6/src/legacy.c:569:12: note: declared here
#  569 | ssh_string publickey_to_string(ssh_public_key pubkey) {
#      |            ^~~~~~~~~~~~~~~~~~~
#  189|       privatekey_free(privkey);
#  190|   
#  191|->     pubkey_new = publickey_to_string(pubkey);
#  192|       publickey_free(pubkey);
#  193|   

Error: COMPILER_WARNING (CWE-477): [#def173]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:192:5: warning[-Wdeprecated-declarations]: ‘publickey_free’ is deprecated
#  192 |     publickey_free(pubkey);
#      |     ^~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:355:6: note: declared here
#  355 | void publickey_free(ssh_public_key key) {
#      |      ^~~~~~~~~~~~~~
#  190|   
#  191|       pubkey_new = publickey_to_string(pubkey);
#  192|->     publickey_free(pubkey);
#  193|   
#  194|       assert_non_null(pubkey_new);

Error: COMPILER_WARNING (CWE-477): [#def174]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:201:5: warning[-Wdeprecated-declarations]: ‘ssh_publickey_to_file’ is deprecated
#  201 |     rc = ssh_publickey_to_file(session, LIBSSH_RSA_TESTKEY ".pub", pubkey_new, type_new);
#      |     ^~
libssh-0.10.6/src/legacy.c:609:5: note: declared here
#  609 | int ssh_publickey_to_file(ssh_session session,
#      |     ^~~~~~~~~~~~~~~~~~~~~
#  199|                           ssh_string_len(pubkey_orig));
#  200|   
#  201|->     rc = ssh_publickey_to_file(session, LIBSSH_RSA_TESTKEY ".pub", pubkey_new, type_new);
#  202|       assert_true(rc == 0);
#  203|   

Error: COMPILER_WARNING (CWE-477): [#def175]
libssh-0.10.6/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_privatekey_from_file’
libssh-0.10.6/tests/unittests/torture_keyfiles.c:231:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
#  231 |     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL);
#      |     ^~~
libssh-0.10.6/src/legacy.c:423:17: note: declared here
#  423 | ssh_private_key privatekey_from_file(ssh_session session,
#      |                 ^~~~~~~~~~~~~~~~~~~~
#  229|       ssh_private_key key = NULL;
#  230|   
#  231|->     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, NULL);
#  232|       assert_non_null(key);
#  233|       if (key != NULL) {

Error: COMPILER_WARNING (CWE-477): [#def176]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:234:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
#  234 |         privatekey_free(key);
#      |         ^~~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:480:6: note: declared here
#  480 | void privatekey_free(ssh_private_key prv) {
#      |      ^~~~~~~~~~~~~~~
#  232|       assert_non_null(key);
#  233|       if (key != NULL) {
#  234|->         privatekey_free(key);
#  235|           key = NULL;
#  236|       }

Error: COMPILER_WARNING (CWE-477): [#def177]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:248:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
#  248 |     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
#      |     ^~~
libssh-0.10.6/src/legacy.c:423:17: note: declared here
#  423 | ssh_private_key privatekey_from_file(ssh_session session,
#      |                 ^~~~~~~~~~~~~~~~~~~~
#  246|   
#  247|       /* Test the automatic type discovery */
#  248|->     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, NULL);
#  249|       assert_non_null(key);
#  250|       if (key != NULL) {

Error: COMPILER_WARNING (CWE-477): [#def178]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:251:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
#  251 |         privatekey_free(key);
#      |         ^~~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:480:6: note: declared here
#  480 | void privatekey_free(ssh_private_key prv) {
#      |      ^~~~~~~~~~~~~~~
#  249|       assert_non_null(key);
#  250|       if (key != NULL) {
#  251|->         privatekey_free(key);
#  252|           key = NULL;
#  253|       }

Error: COMPILER_WARNING (CWE-477): [#def179]
libssh-0.10.6/tests/unittests/torture_keyfiles.c: scope_hint: In function ‘torture_privatekey_from_file_passphrase’
libssh-0.10.6/tests/unittests/torture_keyfiles.c:272:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
#  272 |     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, TORTURE_TESTKEY_PASSWORD);
#      |     ^~~
libssh-0.10.6/src/legacy.c:423:17: note: declared here
#  423 | ssh_private_key privatekey_from_file(ssh_session session,
#      |                 ^~~~~~~~~~~~~~~~~~~~
#  270|       ssh_private_key key = NULL;
#  271|   
#  272|->     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, SSH_KEYTYPE_RSA, TORTURE_TESTKEY_PASSWORD);
#  273|       assert_non_null(key);
#  274|       if (key != NULL) {

Error: COMPILER_WARNING (CWE-477): [#def180]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:275:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
#  275 |         privatekey_free(key);
#      |         ^~~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:480:6: note: declared here
#  480 | void privatekey_free(ssh_private_key prv) {
#      |      ^~~~~~~~~~~~~~~
#  273|       assert_non_null(key);
#  274|       if (key != NULL) {
#  275|->         privatekey_free(key);
#  276|           key = NULL;
#  277|       }

Error: COMPILER_WARNING (CWE-477): [#def181]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:289:5: warning[-Wdeprecated-declarations]: ‘privatekey_from_file’ is deprecated
#  289 |     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, TORTURE_TESTKEY_PASSWORD);
#      |     ^~~
libssh-0.10.6/src/legacy.c:423:17: note: declared here
#  423 | ssh_private_key privatekey_from_file(ssh_session session,
#      |                 ^~~~~~~~~~~~~~~~~~~~
#  287|   
#  288|       /* Test the automatic type discovery */
#  289|->     key = privatekey_from_file(session, LIBSSH_RSA_TESTKEY, 0, TORTURE_TESTKEY_PASSWORD);
#  290|       assert_non_null(key);
#  291|       if (key != NULL) {

Error: COMPILER_WARNING (CWE-477): [#def182]
libssh-0.10.6/tests/unittests/torture_keyfiles.c:292:9: warning[-Wdeprecated-declarations]: ‘privatekey_free’ is deprecated
#  292 |         privatekey_free(key);
#      |         ^~~~~~~~~~~~~~~
libssh-0.10.6/src/legacy.c:480:6: note: declared here
#  480 | void privatekey_free(ssh_private_key prv) {
#      |      ^~~~~~~~~~~~~~~
#  290|       assert_non_null(key);
#  291|       if (key != NULL) {
#  292|->         privatekey_free(key);
#  293|           key = NULL;
#  294|       }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def183]
libssh-0.10.6/tests/unittests/torture_moduli.c: scope_hint: In function ‘torture_retrieve_dhgroup_file’
libssh-0.10.6/tests/unittests/torture_moduli.c:84:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘tmpfile()’ where non-null expected
libssh-0.10.6/tests/torture.h:27: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_moduli.c:5: included_from: Included from here.
/usr/include/stdio.h:745: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: CLANG_WARNING: [#def184]
libssh-0.10.6/tests/unittests/torture_options.c:1250:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 1248|       assert_int_equal(rc, SSH_OK);
# 1249|       id = strdup("2");
# 1250|->     rc = ssh_list_append(awaited_list, id);
# 1251|       assert_int_equal(rc, SSH_OK);
# 1252|       id = strdup("3");

Error: CLANG_WARNING: [#def185]
libssh-0.10.6/tests/unittests/torture_options.c:1253:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 1251|       assert_int_equal(rc, SSH_OK);
# 1252|       id = strdup("3");
# 1253|->     rc = ssh_list_append(awaited_list, id);
# 1254|       assert_int_equal(rc, SSH_OK);
# 1255|       id = strdup("007");

Error: CLANG_WARNING: [#def186]
libssh-0.10.6/tests/unittests/torture_options.c:1256:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 1254|       assert_int_equal(rc, SSH_OK);
# 1255|       id = strdup("007");
# 1256|->     rc = ssh_list_append(awaited_list, id);
# 1257|       assert_int_equal(rc, SSH_OK);
# 1258|       id = strdup("%d/do_not_expand");

Error: CLANG_WARNING: [#def187]
libssh-0.10.6/tests/unittests/torture_options.c:1259:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 1257|       assert_int_equal(rc, SSH_OK);
# 1258|       id = strdup("%d/do_not_expand");
# 1259|->     rc = ssh_list_append(awaited_list, id);
# 1260|       assert_int_equal(rc, SSH_OK);
# 1261|       /* append the defaults; this list is copied from ssh_new@src/session.c */

Error: CLANG_WARNING: [#def188]
libssh-0.10.6/tests/unittests/torture_options.c:1263:10: warning[unix.Malloc]: Potential leak of memory pointed to by 'id'
# 1261|       /* append the defaults; this list is copied from ssh_new@src/session.c */
# 1262|       id = ssh_path_expand_escape(session, "%d/id_ed25519");
# 1263|->     rc = ssh_list_append(awaited_list, id);
# 1264|       assert_int_equal(rc, SSH_OK);
# 1265|   #ifdef HAVE_ECC

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
libssh-0.10.6/tests/unittests/torture_options.c: scope_hint: In function ‘torture_options_apply’
libssh-0.10.6/tests/unittests/torture_options.c:1297:1: warning[-Wanalyzer-malloc-leak]: leak of ‘id’
libssh-0.10.6/tests/torture.h:37: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_options.c:11: included_from: Included from here.
# 1295|   
# 1296|       ssh_list_free(awaited_list);
# 1297|-> }
# 1298|   
# 1299|   static void torture_options_set_verbosity (void **state)

Error: CLANG_WARNING: [#def190]
libssh-0.10.6/tests/unittests/torture_pki.c:296:13: warning[core.NullDereference]: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'key')
#  294|               assert_true(rc == SSH_OK);
#  295|               assert_non_null(key);
#  296|->             assert_int_equal(key->type, sig_type);
#  297|               assert_string_equal(key->type_c, skey_attrs.type_c);
#  298|               bits = ssh_key_size(key);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def191]
libssh-0.10.6/tests/torture.h:37: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki.c:9: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’
libssh-0.10.6/tests/unittests/torture_pki.c:296:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘key’
libssh-0.10.6/include/libssh/wrapper.h:28: included_from: Included from here.
libssh-0.10.6/src/pki.c:36: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki.c:8: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki.c:277:17: note: in expansion of macro ‘ssh_fips_mode’
#  294|               assert_true(rc == SSH_OK);
#  295|               assert_non_null(key);
#  296|->             assert_int_equal(key->type, sig_type);
#  297|               assert_string_equal(key->type_c, skey_attrs.type_c);
#  298|               bits = ssh_key_size(key);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def192]
libssh-0.10.6/tests/unittests/torture_pki.c:320:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
libssh-0.10.6/tests/unittests/torture_pki.c:277:17: note: in expansion of macro ‘ssh_fips_mode’
libssh-0.10.6/include/libssh/session.h:25: included_from: Included from here.
libssh-0.10.6/src/pki.c:61: included_from: Included from here.
libssh-0.10.6/src/pki.c:136:5: note: in expansion of macro ‘ZERO_STRUCTP’
libssh-0.10.6/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’
#  318|               sign = pki_do_sign(key, INPUT, input_length, hash);
#  319|               assert_non_null(sign);
#  320|->             assert_int_equal(sign->type, key->type);
#  321|               assert_string_equal(sign->type_c, skey_attrs.sig_type_c);
#  322|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def193]
libssh-0.10.6/tests/unittests/torture_pki.c:400:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘pubkey’
libssh-0.10.6/tests/unittests/torture_pki.c:277:17: note: in expansion of macro ‘ssh_fips_mode’
libssh-0.10.6/src/pki.c:136:5: note: in expansion of macro ‘ZERO_STRUCTP’
libssh-0.10.6/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’
libssh-0.10.6/tests/unittests/torture_pki.c:348:21: note: in expansion of macro ‘ssh_fips_mode’
libssh-0.10.6/tests/unittests/torture_pki.c:362:17: note: in expansion of macro ‘SSH_LOG’
libssh-0.10.6/src/pki.c:136:5: note: in expansion of macro ‘ZERO_STRUCTP’
libssh-0.10.6/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’
#  398|                                                     sig_type,
#  399|                                                     import_sig->hash_type);
#  400|->                 if (ssh_key_type_plain(verify_pubkey->type) == sig_type) {
#  401|                       /* Importing with the same key type should work */
#  402|                       assert_non_null(new_sig);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def194]
libssh-0.10.6/tests/unittests/torture_pki.c:400:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘verify_key’
libssh-0.10.6/tests/unittests/torture_pki.c:277:17: note: in expansion of macro ‘ssh_fips_mode’
libssh-0.10.6/src/pki.c:136:5: note: in expansion of macro ‘ZERO_STRUCTP’
libssh-0.10.6/tests/unittests/torture_pki.c: scope_hint: In function ‘torture_pki_verify_mismatch’
libssh-0.10.6/tests/unittests/torture_pki.c:348:21: note: in expansion of macro ‘ssh_fips_mode’
libssh-0.10.6/tests/unittests/torture_pki.c:362:17: note: in expansion of macro ‘SSH_LOG’
#  398|                                                     sig_type,
#  399|                                                     import_sig->hash_type);
#  400|->                 if (ssh_key_type_plain(verify_pubkey->type) == sig_type) {
#  401|                       /* Importing with the same key type should work */
#  402|                       assert_non_null(new_sig);

Error: CLANG_WARNING: [#def195]
libssh-0.10.6/tests/unittests/torture_pki.c:400:40: warning[core.NullDereference]: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'verify_pubkey')
#  398|                                                     sig_type,
#  399|                                                     import_sig->hash_type);
#  400|->                 if (ssh_key_type_plain(verify_pubkey->type) == sig_type) {
#  401|                       /* Importing with the same key type should work */
#  402|                       assert_non_null(new_sig);

Error: CLANG_WARNING: [#def196]
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c:523:5: warning[core.NullDereference]: Access to field 'ecdsa_nid' results in a dereference of a null pointer (loaded from variable 'pubkey')
#  521|       assert_int_equal(rc, 0);
#  522|       assert_non_null(pubkey);
#  523|->     assert_int_equal(pubkey->ecdsa_nid, privkey->ecdsa_nid);
#  524|   
#  525|       SSH_KEY_FREE(pubkey);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def197]
libssh-0.10.6/tests/torture.h:37: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c:9: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c: scope_hint: In function ‘torture_pki_ecdsa_name’
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c:920:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c:8: included_from: Included from here.
libssh-0.10.6/tests/unittests/torture_pki_ecdsa.c: scope_hint: In function ‘torture_pki_ecdsa_name’
/usr/include/openssl/ec.h:23: included_from: Included from here.
libssh-0.10.6/include/libssh/libcrypto.h:36: included_from: Included from here.
libssh-0.10.6/include/libssh/wrapper.h:28: included_from: Included from here.
libssh-0.10.6/src/pki.c:36: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
#  918|   
#  919|       etype_char =ssh_pki_key_ecdsa_name(key);
#  920|->     assert_true(strcmp(etype_char, expected_name) == 0);
#  921|   
#  922|       SSH_KEY_FREE(key);

Error: COMPILER_WARNING (CWE-252): [#def198]
libssh-0.10.6/tests/unittests/torture_pki_ecdsa_uri.c: scope_hint: In function ‘torture_pki_ecdsa_publickey_from_privatekey_uri’
libssh-0.10.6/tests/unittests/torture_pki_ecdsa_uri.c:215:5: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
#  215 |     system(convert_key_to_pem);
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
#  213|               pub_filename_generated, pub_filename_pem);
#  214|   
#  215|->     system(convert_key_to_pem);
#  216|   
#  217|       rc = torture_read_one_line(pub_filename_pem,

Error: CLANG_WARNING: [#def199]
libssh-0.10.6/tests/unittests/torture_pki_ecdsa_uri.c:457:5: warning[core.NullDereference]: Access to field 'ecdsa_nid' results in a dereference of a null pointer (loaded from variable 'pubkey')
#  455|       assert_int_equal(rc, 0);
#  456|       assert_non_null(pubkey);
#  457|->     assert_int_equal(pubkey->ecdsa_nid, privkey->ecdsa_nid);
#  458|   
#  459|       SSH_KEY_FREE(pubkey);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def200]
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_verify’
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c:791: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
#  789|   
#  790|       /* remove trailing comment */
#  791|->     ptr = strchr(pkey_ptr, ' ');
#  792|       if(ptr != NULL){
#  793|           *ptr = '\0';

Error: GCC_ANALYZER_WARNING (CWE-688): [#def201]
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_verify_bad’
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c:846: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
#  844|   
#  845|       /* remove trailing comment */
#  846|->     ptr = strchr(pkey_ptr, ' ');
#  847|       if(ptr != NULL){
#  848|           *ptr = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def202]
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c: scope_hint: In function ‘torture_pki_ed25519_pubkey_dup’
libssh-0.10.6/tests/unittests/torture_pki_ed25519.c:953:8: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘q’
#  951|       q = strchr(pub_str, ' ');
#  952|       assert_non_null(q);
#  953|->     *q = '\0';
#  954|   
#  955|       rc = ssh_pki_import_pubkey_base64(pub_str,

Error: CPPCHECK_WARNING (CWE-476): [#def203]
libssh-0.10.6/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);

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-253.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibssh-0.10.6-6.fc41
store-results-to/tmp/tmp4rqd_qe5/libssh-0.10.6-6.fc41.tar.xz
time-created2024-04-22 11:07:56
time-finished2024-04-22 11:15:24
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp4rqd_qe5/libssh-0.10.6-6.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp4rqd_qe5/libssh-0.10.6-6.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9