ead: fix array overrun

SVN-Revision: 13902
lede-17.01
Felix Fietkau 2009-01-06 20:10:53 +00:00
parent 0434df7fee
commit 37e9d4cb86
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ handle_set_username(struct ead_packet *pkt, int len, int *nstate)
set_state(EAD_TYPE_SET_USERNAME); /* clear old state */
strncpy(username, user->username, sizeof(username));
username[sizeof(username)] = 0;
username[sizeof(username) - 1] = 0;
msg = &pktbuf->msg;
msg->len = 0;