Hi all,
Does anybody has some idea why this piece of code
Code:
int setIP(char fName[100])
{
FILE *pipein_fp;
char readbuf[100];
char cmd[] = "vmware-cmd ";
char var[] = " setguestinfo ip 68.180.53.46";
strcat(cmd, fName);
strcat(cmd, var);
if (( pipein_fp = popen(cmd, "r")) == NULL)
{
perror("popen");
exit(1);
}
while(fgets(readbuf, 100, pipein_fp))
printf("%s", readbuf);
pclose(pipein_fp);
printf("Server IP for VM set successfully");
return(0);
}
is generating the following error
Code:
setguestinfo(ip 68.180.53.46) = 1
*** stack smashing detected ***: ./TCPEchoServer terminated
Server IP for VM set successfullyAborted (core dumped)
Thanks