Answer the question
In order to leave comments, you need to log in
Why does lstat() generate "stack smashing detected"?
Installed the system on 2018-07-29.
int main(int argc, char* argv[]){
char* pszPath = "/tmp/";
struct stat xST[2]; <------
printf("<sizeof=%d>\n",sizeof(struct stat));
//memset(&xST,0,sizeof(struct stat));
if (lstat(pszPAth,&xST[0])){ printf("no\n"); return 0; }
printf("ok\n");
return 0;
}
ok
*** stack smashing detected ***: terminated
./test.sh: line 4: 5239 Aborted
le.elf /.........
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question