replace strlen() calls with strnlen() and appropriate maximums

This commit is contained in:
Michael Rash
2012-07-22 23:13:39 -04:00
parent 335abdd545
commit 6255bff95f
8 changed files with 32 additions and 17 deletions

View File

@@ -35,6 +35,8 @@
/* Define some limits (--DSS XXX: These sizes need to be reviewed)
*/
#define MAX_SPA_ENCRYPTED_SIZE 1500
#define MAX_SPA_CMD_LEN 1400
#define MAX_SPA_USERNAME_SIZE 64
#define MAX_SPA_MESSAGE_SIZE 256
#define MAX_SPA_NAT_ACCESS_SIZE 128
@@ -44,6 +46,7 @@
#define MAX_SPA_MESSAGE_TYPE_SIZE 2
#define MIN_SPA_ENCODED_MSG_SIZE 36 /* Somewhat arbitrary */
#define MAX_SPA_ENCODED_MSG_SIZE MAX_SPA_ENCRYPTED_SIZE
#define MIN_GNUPG_MSG_SIZE 400
#define MIN_SPA_FIELDS 6
#define MAX_SPA_FIELDS 10