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

fixing security issue and null pointer dereference #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions client/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static DialServer* getServerFromUser( vector<DialServer*> list )
printf("0: Rescan and list DIAL servers\n");
printServerList(list);
printf("Enter server: ");
scanf("%s", buf);
fgets(buf, 80, stdin);
unsigned int server = atoi(buf);
if( server > 0 && server <= list.size()){
pServer = list[server-1];
Expand Down Expand Up @@ -233,7 +233,7 @@ int handleUser(DialDiscovery *pDial) {
printf("10. Wake up on lan/wlan\n");
printf("11. QUIT\n");
printf("Command (0:1:2:3:4:5:6:7:8:9:10:11): ");
scanf("%s", buf);
fgets(buf, 80, stdin);
switch( atoi(buf) )
{
case 0:
Expand Down Expand Up @@ -330,7 +330,10 @@ int parseArgs( int argc, char* argv[] )
}
break;
case 'o':
if(argv[++i])
{
gOutputFile = argv[++i];
}
break;
case 'a':
gIpAddress = argv[++i];
Expand Down