[net.sources.bugs] bug in arc with fix

stu@jpusa1.UUCP (Stu Heiss) (10/10/86)

Oops!!!  Got this back from Steve Spearman (ihnp4!ihlpf!spear)...

>                                    There is a serious bug I thought
>you would be interested in though.  In arcunix.c, the xrealloc routine
>calls it self recursively forever because of the #define of realloc
>to xrealloc.  This causes, for example, any command with more than
>one file name to fail - in our systems it runs out of swap space.  The
>fix was simply to #undef realloc right before the call in xrealloc.

Hope this clears up the trouble a couple of bsd sites had reported.
Context diff follows.

*** /tmp/,RCSt1a27045	Fri Oct 10 02:42:43 1986
--- arcunix.c	Fri Oct 10 02:42:03 1986
***************
*** 5,10
  #include <sys/errno.h>
  #include <time.h>
  #include "arc.h"
  
  char *index(), *rindex(), *xalloc(), *malloc(), *realloc();
  extern char *Progname;

--- 5,11 -----
  #include <sys/errno.h>
  #include <time.h>
  #include "arc.h"
+ #undef realloc
  
  char *index(), *rindex(), *xalloc(), *malloc(), *realloc();
  extern char *Progname;
-- 
Stu Heiss {ihnp4!jpusa1!stu}