[5820] in Athena Bugs

home help back first fref pref prev next nref lref last post

discuss bug (pmax/ultrix)

daemon@ATHENA.MIT.EDU (John T Kohl)
Fri Aug 24 10:38:54 1990

Date: Fri, 24 Aug 90 10:38:42 -0400
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU

null pointer deref in the function ds().

*** /tmp/,RCSt1008165	Fri Aug 24 10:36:50 1990
--- libds/dsname.c	Tue Jul 31 22:30:07 1990
***************
*** 67,75 ****
  INLINE static char * ds(s)
      const char *s;
  {
!     register int len = strlen (s) + 1;
!     register char *ns = malloc (len);
!     bcopy (s, ns, len);
      return (ns);
  }
  
--- 67,82 ----
  INLINE static char * ds(s)
      const char *s;
  {
!     register int len;
!     register char *ns;
!     if (s) {
! 	len = strlen (s) + 1;
! 	ns = malloc (len);
! 	bcopy (s, ns, len);
!     } else {
! 	ns = malloc(1);
! 	*ns = '\0';
!     }
      return (ns);
  }
  

home help back first fref pref prev next nref lref last post