diff options
author | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-10 22:35:24 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@cvs.openbsd.org> | 2008-11-10 22:35:24 +0000 |
commit | 7cfd80801e50b4d8d4dae054183ef3e33b901de9 (patch) | |
tree | 3dd8d2516fb8cc68d908b1717044604a09c69f0b /usr.sbin/smtpd/parse.y | |
parent | 11802a4868ef558ab127a5dcac1207b60a1a26e4 (diff) |
- define MAX_LINE_SIZE which is the maximum length of a line we allow from
a client. it must be set to the highest value we have from all of
the extensions which are/will be implemented.
- replace all occurences of STRLEN define with MAX_LINE_SIZE, kill STRLEN
Diffstat (limited to 'usr.sbin/smtpd/parse.y')
-rw-r--r-- | usr.sbin/smtpd/parse.y | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index d8a1b7cb55a..ab0deccb8c9 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.7 2008/11/10 17:24:24 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.8 2008/11/10 22:35:23 gilles Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -453,8 +453,8 @@ mapref : STRING { free(m); YYERROR; } - spret = snprintf(m->m_name, STRLEN, "<dynamic(%u)>", m->m_id); - if (spret == -1 || spret >= STRLEN) + spret = snprintf(m->m_name, MAX_LINE_SIZE, "<dynamic(%u)>", m->m_id); + if (spret == -1 || spret >= MAX_LINE_SIZE) fatal("snprintf"); m->m_flags |= F_DYNAMIC|F_USED; m->m_type = T_SINGLE; @@ -528,8 +528,8 @@ mapref : STRING { free(m); YYERROR; } - spret = snprintf(m->m_name, STRLEN, "<dynamic(%u)>", m->m_id); - if (spret == -1 || spret >= STRLEN) + spret = snprintf(m->m_name, MAX_LINE_SIZE, "<dynamic(%u)>", m->m_id); + if (spret == -1 || spret >= MAX_LINE_SIZE) fatal("snprintf"); m->m_flags |= F_DYNAMIC|F_USED; m->m_type = T_LIST; @@ -555,8 +555,8 @@ mapref : STRING { free(m); YYERROR; } - spret = snprintf(m->m_name, STRLEN, "<dynamic(%u)>", m->m_id); - if (spret == -1 || spret >= STRLEN) + spret = snprintf(m->m_name, MAX_LINE_SIZE, "<dynamic(%u)>", m->m_id); + if (spret == -1 || spret >= MAX_LINE_SIZE) fatal("snprintf"); m->m_flags |= F_DYNAMIC|F_USED; m->m_type = T_HASH; @@ -682,8 +682,8 @@ from : FROM mapref { free(m); YYERROR; } - spret = snprintf(m->m_name, STRLEN, "<dynamic(%u)>", m->m_id); - if (spret == -1 || spret >= STRLEN) + spret = snprintf(m->m_name, MAX_LINE_SIZE, "<dynamic(%u)>", m->m_id); + if (spret == -1 || spret >= MAX_LINE_SIZE) fatal("snprintf"); m->m_flags |= F_DYNAMIC|F_USED; m->m_type = T_SINGLE; |