1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

coverity 169275 - lwsgt check string bounds

This commit is contained in:
Andy Green 2016-08-28 09:12:39 +08:00
parent 16f3e4cacf
commit e0212b8c85

View file

@ -304,7 +304,8 @@ lwsgs_handler_change_password(struct per_vhost_data__gs *vhd, struct lws *wsi,
return 1;
}
strcpy(u.username, lws_spa_get_string(pss->spa, FGS_USERNAME));
strncpy(u.username, lws_spa_get_string(pss->spa, FGS_USERNAME), sizeof(u.username) - 1);
u.username[sizeof(u.username) - 1] = '\0';
}
/* does he want to delete his account? */