Commit 8ab33939 authored by David Byers's avatar David Byers

Fixed crash that could occur when receiving long aux-item lists

parent 655ff22a
2000-05-09 David Byers <davby@ida.liu.se>
The server could crash when parsing over-long aux-item lists.
* src/server/connections.h: Added dummy_aux_item field.
* src/server/prot-a-parse.c (prot_a_parse_string):
(prot_a_parse_aux_item_list): Use dummy_aux_item in client
structure instead of an auto variable.
* src/server/connections.c (free_parsed): Clear
client->dummy_aux_item.
2000-04-28 Per Cederqvist <ceder@lysator.liu.se>
The data base was saved even when "Never save: true" was used.
......
/*
* $Id: connections.c,v 0.67 1999/10/28 13:18:07 byers Exp $
* $Id: connections.c,v 0.68 2000/05/09 11:31:14 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -36,7 +36,7 @@
#endif
static const char *
rcsid = "$Id: connections.c,v 0.67 1999/10/28 13:18:07 byers Exp $";
rcsid = "$Id: connections.c,v 0.68 2000/05/09 11:31:14 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -301,6 +301,7 @@ free_parsed(Connection *client)
client->misc_info_list.misc = 0;
client->misc_info_list.no_of_misc = 0;
s_clear(&client->aux_item.data);
s_clear(&client->dummy_aux_item.data);
sfree( client->c_local_text_no_p);
client->c_local_text_no_p = NULL;
client->parse_pos = 0;
......
/*
* $Id: connections.h,v 0.44 1999/05/24 09:34:22 ceder Exp $
* $Id: connections.h,v 0.45 2000/05/09 11:31:14 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -23,7 +23,7 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
/*
* $Id: connections.h,v 0.44 1999/05/24 09:34:22 ceder Exp $
* $Id: connections.h,v 0.45 2000/05/09 11:31:14 byers Exp $
*
* connections.h -- The top level of the communication packet.
*
......@@ -100,6 +100,7 @@ typedef struct connection {
Misc_info_list misc_info_list;
Aux_item_list aux_item_list; /* Freed by free_parsed() */
Aux_item aux_item; /* Freed by free_parsed() */
Aux_item dummy_aux_item; /* Freed by free_parsed() */
Local_text_no *c_local_text_no_p; /* Freead by free_parsed(). */
Priv_bits priv_bits;
Conf_type conf_type;
......
/*
* $Id: prot-a-parse.c,v 0.43 1999/06/24 12:58:47 ceder Exp $
* $Id: prot-a-parse.c,v 0.44 2000/05/09 11:31:15 byers Exp $
* Copyright (C) 1991-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -34,7 +34,7 @@
#endif
static const char *
rcsid = "$Id: prot-a-parse.c,v 0.43 1999/06/24 12:58:47 ceder Exp $";
rcsid = "$Id: prot-a-parse.c,v 0.44 2000/05/09 11:31:15 byers Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -482,7 +482,6 @@ prot_a_parse_aux_item_list(Connection *client,
{
static unsigned long err_cnt = 0;
int i;
Aux_item dummy_aux_item;
switch (client->array_parse_pos)
{
......@@ -534,8 +533,8 @@ prot_a_parse_aux_item_list(Connection *client,
}
else
{
prot_a_parse_aux_item(client, &dummy_aux_item);
clear_aux_item(&dummy_aux_item);
prot_a_parse_aux_item(client, &client->dummy_aux_item);
clear_aux_item(&client->dummy_aux_item);
}
client->array_parse_index += 1;
}
......
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