diff -Xcvsignore -ur kdenetwork-3.0.4/lanbrowsing/kio_lan/kio_lan.cpp kdenetwork-3.0.5/lanbrowsing/kio_lan/kio_lan.cpp --- kdenetwork-3.0.4/lanbrowsing/kio_lan/kio_lan.cpp 2002-01-03 21:34:12.000000000 +0100 +++ kdenetwork-3.0.5/lanbrowsing/kio_lan/kio_lan.cpp 2002-11-07 11:24:19.000000000 +0100 @@ -176,13 +176,14 @@ char *currentBuf=receiveBuffer; int bytesLeft=receivedBytes; - int tmpIP; //this should be large enough for a name - char tmpName[1024]; + char tmpName[4*1024]; //this should be large enough for the hostname - char tmpHostname[512]; + char tmpHostname[4*1024]; while (bytesLeft>0) { + int tmpIP=2; + tmpName[0]='\0'; if ((memchr(currentBuf,0,bytesLeft)==0) || (memchr(currentBuf,int('\n'),bytesLeft)==0)) { delete [] receiveBuffer; @@ -190,17 +191,19 @@ return 0; }; kdDebug(7101)<<"LANProtocol::lanReadDataFromServer: processing "<0) { + int tmpIP=2; + tmpName[0]='\0'; if ((memchr(currentBuf,0,bytesLeft)==0) || (memchr(currentBuf,int('\n'),bytesLeft)==0)) { delete [] receiveBuffer; @@ -358,17 +362,19 @@ return 0; }; kdDebug(7101)<<"RLANProtocol::readDataFromServer: processing "<h_addr, hp->h_length); + memcpy(&ip, hp->h_addr, sizeof(ip)); for (int i=0; i #include #include +#include #ifndef AF_LOCAL #define AF_LOCAL AF_UNIX @@ -70,7 +71,7 @@ NetManager::~NetManager() { - mgetDebug()<<"netknife destructor ..."<pw_name; + else + //should never happen + socketName+="???"; ::unlink(socketName.data()); sockaddr_un serverAddr; -// bzero((char*)&serverAddr, sizeof(serverAddr)); + if (socketName.length() >= sizeof(serverAddr.sun_path)) + { + std::cout<<"NetManager::prepare: your user name \""<pw_name<<"\" is too long, exiting."<2*1024*1024) + return 0; + return 1; }; @@ -665,14 +684,15 @@ char *tmpBuf=m_receiveBuffer; int bytesLeft=m_receivedBytes; - int tmpIP; mgetDebug()<<"m_receivedBytes: "<0) { + int tmpIP=2; // well, some impossible IP address, 0 and 1 are already used for the last line of output + tmpName[0]='\0'; if ((memchr(tmpBuf,0,bytesLeft)==0) || (memchr(tmpBuf,int('\n'),bytesLeft)==0)) { delete newNodes; @@ -687,14 +707,16 @@ return 0; }; //mgetDebug()<<"NetManager::processScanResults: processing -"<append(Node(tmpName,tmpIP)); diff -Xcvsignore -ur kdenetwork-3.0.4/lanbrowsing/lisa/netscanner.cpp kdenetwork-3.0.5/lanbrowsing/lisa/netscanner.cpp --- kdenetwork-3.0.4/lanbrowsing/lisa/netscanner.cpp 2002-02-02 23:27:59.000000000 +0100 +++ kdenetwork-3.0.5/lanbrowsing/lisa/netscanner.cpp 2002-11-07 11:24:19.000000000 +0100 @@ -36,6 +36,10 @@ #include #include +#ifndef INADDR_NONE +#define INADDR_NONE -1 +#endif + #define mgetDebug() getDebug()<=STRICTMODEMAXHOSTS)) break; - memcpy(&server_addr, hp->h_addr, hp->h_length); + memcpy(&server_addr, hp->h_addr, sizeof(server_addr)); char *ip=inet_ntoa(server_addr); mgetDebug()<<"NetScanner::configure(): looking up "<