Great Circle Associates Firewalls
(April 1994)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: system()
From: jim @ Tadpole . COM (Jim Thompson)
Date: Thu, 7 Apr 94 00:17:54 CDT
To: Firewalls @ GreatCircle . COM, kmayer @ mrj . com

I don't know if I'd trust anything that tromps through what could be a
NULL pointer.  In this case, 'dst' could be NULL (if malloc fails), and
the program would print the warning, then dump core (unless run on a
little-endian machine, say, a VAX.)

Jim

/* strndup - make copy of string */
static char *strndup(str, len)
char   *str;
int     len;
{
    char   *dst;

    if ((dst = malloc(len + 1)) == 0)
      fprintf(stderr, "%s: out of memory\n", myname);
    dst[len] = 0;
    return (strncpy(dst, str, len));
}

Indexed By Date Previous: Re: system()
From: Ken Mayer <kmayer @ mrj . com>
Next: Re: system() -> Mosaic
From: johns @ oxygen . house . gov (John Schnizlein)
Indexed By Thread Previous: Re: system()
From: Ken Mayer <kmayer @ mrj . com>
Next: "One time passwords"
From: Luther Garcia <luth @ sprintlink . net>

Google
 
Search Internet Search www.greatcircle.com