[BACK]Return to netcat.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / nc

Diff for /src/usr.bin/nc/netcat.c between version 1.59 and 1.60

version 1.59, 2003/06/26 21:59:11 version 1.60, 2003/07/07 14:12:18
Line 377 
Line 377 
   
         memset(&sun, 0, sizeof(struct sockaddr_un));          memset(&sun, 0, sizeof(struct sockaddr_un));
         sun.sun_family = AF_UNIX;          sun.sun_family = AF_UNIX;
         strlcpy(sun.sun_path, path, sizeof(sun.sun_path));  
           if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
               sizeof(sun.sun_path)) {
                   close(s);
                   errno = ENAMETOOLONG;
                   return (-1);
           }
         if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {          if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {
                 close(s);                  close(s);
                 return (-1);                  return (-1);
Line 400 
Line 406 
         if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)          if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
                 return (-1);                  return (-1);
   
         strlcpy(sun.sun_path, path, sizeof(sun.sun_path));          memset(&sun, 0, sizeof(struct sockaddr_un));
         sun.sun_family = AF_UNIX;          sun.sun_family = AF_UNIX;
   
           if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >=
               sizeof(sun.sun_path)) {
                   close(s);
                   errno = ENAMETOOLONG;
                   return (-1);
           }
   
         if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {          if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) {
                 close(s);                  close(s);
                 return (-1);                  return (-1);

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60