[2942] in Release_Engineering
Discuss client calloc error (core dump)
daemon@ATHENA.MIT.EDU (epeisach@Athena.MIT.EDU)
Tue Oct 27 14:38:24 1992
From: epeisach@Athena.MIT.EDU
Date: Tue, 27 Oct 92 14:38:06 -0500
To: bugs@Athena.MIT.EDU, bug-discuss@Athena.MIT.EDU
Cc: rel-eng@Athena.MIT.EDU
I discovered that the malloc arena on the Silicon Graphics is a little
more sensitive to being trashed than on our machines.
Symptom:
Try adding a meeting that already exists. A message comes up indicating
that the meeting already exists. Upon typing the next command core dump.
(Seg violation):
The fix is in discuss/client/addmtg.c
Following the logic of the code, if argc=1, used[1] = 1. Clearly we are
off by one here in terms of memory allocation. (max allowed would be
argc-1 as currently defined). Note that the current defintion will work
for argc >1 throughout the code, just the one fence post...
diff -c -r1.2 addmtg.c
*** /tmp/,RCSt1a25165 Tue Oct 27 14:36:14 1992
--- addmtg.c Tue Oct 27 14:34:35 1992
***************
*** 56,62 ****
trn_info t_info;
selection_list *trn_list,*trn_temp;
! used = (int *)calloc(argc, sizeof(int));
user = "";
realm = user;
set = NULL;
--- 56,62 ----
trn_info t_info;
selection_list *trn_list,*trn_temp;
! used = (int *)calloc(argc+1, sizeof(int));
user = "";
realm = user;
set = NULL;