Open songxpu opened 1 year ago
This type of bug which can lead to undefined behaviors, but it may not cause serious impact at this project.
Another bug is in server.c:51, it is because state does not initialize username after allocating memory space.
State *state = malloc(sizeof(State));
...
printf("User %s sent command: %s\r\n",(state->username==0)?"unknown":state->username,buffer); // line 51
ASAN:
how you find the bug? can you share?
There is a small bug in server.c:173
ASAN
Reproduce