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. * Copyright (C) 1991, 1993, 1994, 1995 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
* This is a hack. Clean this mess up with lacgen. * 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" #include "rcs.h"
USE(rcsid); USE(rcsid);
...@@ -137,6 +137,12 @@ mux_parse_string(Mux *mux, ...@@ -137,6 +137,12 @@ mux_parse_string(Mux *mux,
{ {
longjmp(mux_parse_env, MUX_MSG_INCOMPLETE); 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 /* Check that
a) there is a trailing H a) there is a trailing 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