From cef5b35c47f1807300335ab00e9ae6c28d005bb0 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Fri, 21 Jan 2005 22:51:25 +0000 Subject: [PATCH] Remove any CR/LF from attributes submitted from browser SVN revision: 1181 --- src/elogd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/elogd.c b/src/elogd.c index a9656c90..e1c5f17f 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.543 2005/01/21 22:51:25 ritt + Remove any CR/LF from attributes submitted from browser + Revision 1.542 2005/01/21 22:21:24 ritt Fixed compiler warning @@ -16718,6 +16721,12 @@ void submit_elog(LOGBOOK * lbs) } else { strlcpy(attrib[i], getparam(ua), NAME_LENGTH); + /* remove any CR/LF */ + if (strchr(attrib[i], '\r')) + *strchr(attrib[i], '\r') = 0; + if (strchr(attrib[i], '\n')) + *strchr(attrib[i], '\n') = 0; + /* strip trailing "{...}" */ if (is_cond_attr(i) && strchr(attrib[i], '{') && strchr(attrib[i], '}')) *strchr(attrib[i], '{') = 0;