Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix coverity errors #54

Open
gjedeer opened this issue Nov 17, 2018 · 0 comments
Open

Fix coverity errors #54

gjedeer opened this issue Nov 17, 2018 · 0 comments

Comments

@gjedeer
Copy link
Owner

gjedeer commented Nov 17, 2018

Subject: New Defects reported by Coverity Scan for gjedeer/tuntox
Date: Sat, 17 Nov 2018 11:40:52 +0000 (UTC)

Hi,

Please find the latest report on new defect(s) introduced to gjedeer/tuntox found with Coverity Scan.

3 new defect(s) introduced to gjedeer/tuntox found with Coverity Scan.


New defect(s) Reported-by: Coverity Scan
Showing 3 of 3 defect(s)


** CID 184347:  Uninitialized variables  (MISSING_RETURN)
/client.c: 262 in client_close_tunnel()


________________________________________________________________________________________________________
*** CID 184347:  Uninitialized variables  (MISSING_RETURN)
/client.c: 262 in client_close_tunnel()
256         if(tun->sockfd)
257         {
258             FD_CLR(tun->sockfd, &client_master_fdset);
259         }
260     
261         tunnel_delete(tun);
>>>     CID 184347:  Uninitialized variables  (MISSING_RETURN)
>>>     Arriving at the end of a function without returning a value.  
262     }
263     
264     /* Close and delete all tunnels (when server went offline) */
265     int client_close_all_connections()
266     {
267     	tunnel *tmp = NULL;

** CID 184346:  Control flow issues  (MISSING_BREAK)
/client.c: 662 in do_client_loop()


________________________________________________________________________________________________________
*** CID 184346:  Control flow issues  (MISSING_BREAK)
/client.c: 662 in do_client_loop()
656     						{
657     							state = CLIENT_STATE_FORWARDING;
658     						}
659     					}
660     				}
661     				break;
>>>     CID 184346:  Control flow issues  (MISSING_BREAK)
>>>     The case for value "-1" is not terminated by a 'break' statement.  
662     			case 0xffffffff:
663     				log_printf(L_ERROR, "You forgot a break statement\n");
664                 case CLIENT_STATE_SHUTDOWN:
665                     exit(0);
666                     break;
667             }
668     
669             usleep(tox_iteration_interval(tox) * 1000);
670         }

** CID 184345:  Uninitialized variables  (MISSING_RETURN)
/client.c: 274 in client_close_all_connections()


________________________________________________________________________________________________________
*** CID 184345:  Uninitialized variables  (MISSING_RETURN)
/client.c: 274 in client_close_all_connections()
268     	tunnel *tun = NULL;
269     
270     	HASH_ITER(hh, by_id, tun, tmp)
271     	{
272     		client_close_tunnel(tun);
273     	}
>>>     CID 184345:  Uninitialized variables  (MISSING_RETURN)
>>>     Arriving at the end of a function without returning a value.  
274     }
275     
276     /* Main loop for the client */
277     int do_client_loop(uint8_t *tox_id_str)
278     {
279         unsigned char tox_packet_buf[PROTOCOL_MAX_PACKET_SIZE];



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant