mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added parameter length check
SVN revision: 301
This commit is contained in:
parent
d583eff9a0
commit
b1f75e4638
12
elogd.c
12
elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 2.110 2002/12/02 16:38:57 midas
|
||||||
|
Added parameter length check
|
||||||
|
|
||||||
Revision 2.109 2002/12/02 07:48:08 midas
|
Revision 2.109 2002/12/02 07:48:08 midas
|
||||||
Implemented 'line as link'
|
Implemented 'line as link'
|
||||||
|
|
||||||
@ -862,7 +865,7 @@ char *pd, *p, str[256];
|
|||||||
|
|
||||||
pd = str;
|
pd = str;
|
||||||
p = ps;
|
p = ps;
|
||||||
while (*p)
|
while (*p && (int)p < (int)str + 250)
|
||||||
{
|
{
|
||||||
if (strchr(" %&=#?", *p))
|
if (strchr(" %&=#?", *p))
|
||||||
{
|
{
|
||||||
@ -3369,6 +3372,13 @@ char str[10000];
|
|||||||
|
|
||||||
if (i<MAX_PARAM)
|
if (i<MAX_PARAM)
|
||||||
{
|
{
|
||||||
|
if (strlen(param) >= PARAM_LENGTH)
|
||||||
|
{
|
||||||
|
sprintf(str, "Error: Parameter name too big (%d bytes).\n", strlen(param));
|
||||||
|
show_error(str);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
strlcpy(_param[i], param, PARAM_LENGTH);
|
strlcpy(_param[i], param, PARAM_LENGTH);
|
||||||
|
|
||||||
if (strlen(value) >= VALUE_SIZE)
|
if (strlen(value) >= VALUE_SIZE)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user