ead: fix array overrun
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13902 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
56046f5ae7
commit
c5254e1d02
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue