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.
*
* This file is part of the LysKOM server.
......@@ -29,7 +29,7 @@
* 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"
USE(rcsid);
......@@ -1143,9 +1143,11 @@ extern Success
fparse_misc_info(FILE *fp,
Misc_info *result)
{
result->type = fparse_long(fp);
long typ;
typ = fparse_long(fp);
switch(result->type)
switch(typ)
{
case recpt:
result->datum.recipient = fparse_long(fp);
......@@ -1194,5 +1196,7 @@ fparse_misc_info(FILE *fp,
return FAILURE;
}
result->type = (Info_type)typ;
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