Weird heap-buffer-overflow on strcpy and strncpy

前端 未结 0 312
攒了一身酷
攒了一身酷 2021-01-25 09:17

I have this code:

char buffer[12];
snprintf(buffer, 12, "%d-%02d-%02d", y, m, d);
strcpy(date, buffer);                      -< this line causes heap         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题