Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

trpt seg faults when attached code is executed

From: david <david(at)wmol.com>
Date: Sun Mar 23 2003 - 08:29:07 EST


Platform: OpenBSD 3.3 on i386

How to repeat:

1.) reboot machine to flush memory?
2.) run trpt with no options (should return to command prompt)
3.) compile and execute source code below..
4.) run trpt with no options...  should seg fault

/* CODE */
#include <sys/types.h>

#include <string.h>
#include <err.h>

int
main(void)
{
 int sockfd;
 struct sockaddr_in serv;
 int on = 1;

 if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)   err(1, "socket");

 if (setsockopt(sockfd, SOL_SOCKET, SO_DEBUG, &on, sizeof(on)) < 0)   err(1, "setsockopt");

 memset(&serv, 0, sizeof(serv));

 serv.sin_family = AF_INET;
 serv.sin_port = htons(22);
 if (inet_pton(AF_INET, "127.0.0.1", &serv.sin_addr) < 0)
  err(1, "inet_pton");
Do you need help?X

 if (connect(sockfd, (struct sockaddr *) & serv, sizeof(serv)) < 0)   err(1, "connect");

 for (;;);
 close(sockfd);
 return (0);
} Received on Sun Mar 23 08:30:14 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:52 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library