Commit 7370c801 authored by Per Cederqvist's avatar Per Cederqvist

(find_linked_aux_item_list): Don't test for the non-used

	PERS_OBJECT_TYPE object type.
(mark_linked_object_as_changed): Likewise.
(aux_item_trigger_mirror_faq): Fixed a buffer overflow.
parent 015205b3
/*
* $Id: aux-items.c,v 1.23 1999/07/05 07:03:25 ceder Exp $
* $Id: aux-items.c,v 1.24 1999/07/10 22:32:40 ceder Exp $
* Copyright (C) 1994-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -597,7 +597,9 @@ find_linked_aux_item_list(Aux_item *item)
case INFO_OBJECT_TYPE:
return &kom_info.aux_item_list;
#if 0
case PERS_OBJECT_TYPE:
#endif
default:
/* No lists in these items */
kom_log("find_linked_aux_item_list: Bad aux_item somewhere: "
......@@ -641,7 +643,9 @@ mark_linked_object_as_changed(Aux_item *item)
break;
case INFO_OBJECT_TYPE:
#if 0
case PERS_OBJECT_TYPE:
#endif
default:
/* Need no commit for these objects */
;
......@@ -761,12 +765,18 @@ aux_item_link_items(Object_type src_type, /* Source object type */
text_stat_add_aux_item_list((Text_stat *)dst_ptr,
(Text_no)dst_no, &item_list,
src_item->creator);
/* FIXME: is this necessary? The call to
mark_linked_object_as_changed below seems to fix this,
right? --ceder 1999-07-10. */
mark_text_as_changed((Text_no)dst_no);
break;
case CONF_OBJECT_TYPE:
conf_stat_add_aux_item_list((Conference *)dst_ptr,
(Conf_no)dst_no, &item_list,
src_item->creator);
/* FIXME: is this necessary? The call to
mark_linked_object_as_changed below seems to fix this,
right? --ceder 1999-07-10. */
mark_conference_as_changed((Conf_no)dst_no);
break;
......@@ -785,6 +795,8 @@ aux_item_link_items(Object_type src_type, /* Source object type */
* objects are the same and reallocing the aux item list causes
* it to move in memory
*/
/* FIXME: but src_item isn't used below this point! What is the
point of setting it to NULL? --ceder 1999-07-10. */
src_item = NULL;
......@@ -1947,8 +1959,8 @@ void aux_item_trigger_mirror_faq(Aux_item_trigger_data *data)
{
Text_no text_no;
Aux_item item_data;
char conf_no_string[40];
String_size ill_char, end_pos;
char conf_no_string[2+3*sizeof(unsigned long)];
String_size ill_char;
String str;
......@@ -1961,15 +1973,9 @@ void aux_item_trigger_mirror_faq(Aux_item_trigger_data *data)
/* Create the string for the new item */
sprintf(conf_no_string, "%-40lu", (unsigned long)data->object_no);
sprintf(conf_no_string, "%lu", (unsigned long)data->object_no);
str = s_fcrea_str(conf_no_string);
end_pos = s_strchr(str, ' ', 0);
if (end_pos != -1)
{
s_strdel(&str, end_pos, s_strlen(str) - 1);
}
/* Fill in the new item */
init_aux_item(&item_data);
......
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