ead: fix array overrun
authorFelix Fietkau <nbd@openwrt.org>
Tue, 6 Jan 2009 20:10:53 +0000 (20:10 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 6 Jan 2009 20:10:53 +0000 (20:10 +0000)
SVN-Revision: 13902

package/ead/src/ead.c

index 91f6fbaf70ca1a9748173b3dd3aa0c03e8588869..6a01ea42dd6198603d425d19f01ebd895ea94fd2 100644 (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;