From 3d751c569e24225464c3ef2e795452402acbf33d Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Thu, 23 Sep 2004 22:06:31 +0000 Subject: [PATCH] Added error when non-existing attachments get submitted SVN revision: 1088 --- src/elogd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/elogd.c b/src/elogd.c index c41f12ed..3ae76c85 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.481 2004/09/23 22:06:31 midas + Added error when non-existing attachments get submitted + Revision 1.480 2004/09/22 19:20:57 midas Fixed superfluous spaces @@ -19262,6 +19265,14 @@ void decode_post(LOGBOOK * lbs, char *string, char *boundary, int length) } else ptmp += strlen(ptmp); } while (TRUE); + + /* check attachment size */ + if ((int) (p - string) == 0) { + sprintf(str, loc("Attachment file \"%s\" empty or not found"), file_name); + show_error(str); + return; + } + /* save attachment */ if (file_name[0]) { el_submit_attachment(lbs, file_name, string, (int) (p - string), full_name);