Y
Y
Yupa201711232018-07-30 16:18:30
linux
Yupa20171123, 2018-07-30 16:18:30

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 /.........

If xST[2] there is no error. If xST[1] or xST - is :(
What can it be? (how can I fly out of the blue:)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question