Commit fed33965 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(mux_parse_string): Check for overflow when parsing the string length.

	Logout the current mux if the string length supplied is so
	large that it becomes a negative number.
parent 1ccfce76
/*
* $Id: mux-parse.c,v 0.16 1995/01/01 20:17:22 ceder Exp $
* $Id: mux-parse.c,v 0.17 1995/10/23 06:55:14 ceder Exp $
* Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -27,7 +27,7 @@
* This is a hack. Clean this mess up with lacgen.
*/
static char *rcsid = "$Id: mux-parse.c,v 0.16 1995/01/01 20:17:22 ceder Exp $";
static char *rcsid = "$Id: mux-parse.c,v 0.17 1995/10/23 06:55:14 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -138,6 +138,12 @@ mux_parse_string(Mux *mux,
longjmp(mux_parse_env, MUX_MSG_INCOMPLETE);
}
if (mux_len < 0)
{
log("Insane string length from mux. Logging out mux.\n");
longjmp(mux_parse_env, MUX_LOGOUT);
}
/* Check that
a) there is a trailing H
b) there was at least one digit before the H */
......
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