Commit 5b13eefc authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(fparse_misc_info): Check that the number fits in an Info_type before

	storing it there.
parent 97e8f47d
/* /*
* $Id: ram-parse.c,v 0.18 1994/04/05 08:03:58 ceder Exp $ * $Id: ram-parse.c,v 0.19 1994/10/22 13:17:30 ceder Exp $
* Copyright (C) 1991, 1993, 1994 Lysator Academic Computer Association. * Copyright (C) 1991, 1993, 1994 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* ram-parse.c -- parse objects from disk file. * ram-parse.c -- parse objects from disk file.
*/ */
static char *rcsid = "$Id: ram-parse.c,v 0.18 1994/04/05 08:03:58 ceder Exp $"; static char *rcsid = "$Id: ram-parse.c,v 0.19 1994/10/22 13:17:30 ceder Exp $";
#include "rcs.h" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -1143,9 +1143,11 @@ extern Success ...@@ -1143,9 +1143,11 @@ extern Success
fparse_misc_info(FILE *fp, fparse_misc_info(FILE *fp,
Misc_info *result) Misc_info *result)
{ {
result->type = fparse_long(fp); long typ;
typ = fparse_long(fp);
switch(result->type) switch(typ)
{ {
case recpt: case recpt:
result->datum.recipient = fparse_long(fp); result->datum.recipient = fparse_long(fp);
...@@ -1194,5 +1196,7 @@ fparse_misc_info(FILE *fp, ...@@ -1194,5 +1196,7 @@ fparse_misc_info(FILE *fp,
return FAILURE; return FAILURE;
} }
result->type = (Info_type)typ;
return OK; return OK;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment