Index: kdenetwork/kmail/kmaddrbook.cpp diff -u kdenetwork/kmail/kmaddrbook.cpp:1.40 kdenetwork/kmail/kmaddrbook.cpp:1.40.2.2 --- kdenetwork/kmail/kmaddrbook.cpp:1.40 Tue Jun 12 11:44:13 2001 +++ kdenetwork/kmail/kmaddrbook.cpp Fri Dec 13 15:29:59 2002 @@ -14,6 +14,7 @@ #include #include #include +#include #include "kmkernel.h" // for KabBridge #include "kmmessage.h" // for KabBridge @@ -329,8 +330,7 @@ KConfigGroupSaver saver(config, "General"); int ab = config->readNumEntry("addressbook", 3); if (ab == 3) { - KRun::runCommand( "kaddressbook -a \"" + addr.replace(QRegExp("\""), "") - + "\"" ); + KRun::runCommand( "kaddressbook -a " + KShellProcess::quote(addr)); return; } if (!KMAddrBookExternal::useKAB()) { Index: kdenetwork/kmail/kmfolder.cpp diff -u kdenetwork/kmail/kmfolder.cpp:1.181.2.2 kdenetwork/kmail/kmfolder.cpp:1.181.2.3 --- kdenetwork/kmail/kmfolder.cpp:1.181.2.2 Thu Aug 9 01:48:58 2001 +++ kdenetwork/kmail/kmfolder.cpp Mon Sep 2 08:07:35 2002 @@ -20,6 +20,7 @@ #include #include +#include #include #include #include Index: kdenetwork/kppp/opener.cpp diff -u kdenetwork/kppp/opener.cpp:1.52 kdenetwork/kppp/opener.cpp:1.52.2.3 --- kdenetwork/kppp/opener.cpp:1.52 Mon Jul 16 14:05:13 2001 +++ kdenetwork/kppp/opener.cpp Fri Dec 13 11:30:22 2002 @@ -59,22 +59,21 @@ #include #ifdef __FreeBSD__ - // For kldload - #include +# include // for kldload #endif #ifdef HAVE_CONFIG_H -#include +# include #endif #ifndef HAVE_NET_IF_PPP_H -#ifdef HAVE_LINUX_IF_PPP_H -#include -#endif +# ifdef HAVE_LINUX_IF_PPP_H +# include +# endif #else -#include -#include -#include +# include +# include +# include #endif #include @@ -91,8 +90,8 @@ #include "devices.h" #ifdef HAVE_RESOLV_H -#include -#include +# include +# include #endif #ifndef _PATH_RESCONF @@ -204,7 +203,7 @@ device = deviceByIndex(request.lock.deviceNum); MY_ASSERT(strlen(LOCK_DIR)+strlen(device) < MaxPathLen); strncpy(lockfile, LOCK_DIR"/LCK..", MaxPathLen); - strncat(lockfile, device + strlen("/dev/"), + strncat(lockfile, strrchr(device, '/') + 1, MaxPathLen - strlen(lockfile)); lockfile[MaxPathLen] = '\0'; response.status = 0; @@ -526,7 +525,8 @@ case 0: // let's parse the arguments the user supplied into UNIX suitable form // that is a list of pointers each pointing to exactly one word - strcpy(buf, arguments); + strncpy(buf, arguments, sizeof(buf)); + buf[sizeof(buf)-1] = '\0'; parseargs(buf, args); // become a session leader and let /dev/ttySx // be the controlling terminal. Index: kdenetwork/kppp/pppstats.cpp diff -u kdenetwork/kppp/pppstats.cpp:1.28 kdenetwork/kppp/pppstats.cpp:1.28.2.1 --- kdenetwork/kppp/pppstats.cpp:1.28 Fri Apr 6 01:39:53 2001 +++ kdenetwork/kppp/pppstats.cpp Fri Dec 13 11:30:23 2002 @@ -162,6 +162,7 @@ } strncpy(ifr.ifr_name, unitName, sizeof(ifr.ifr_name)); + ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; if(ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { if (errno) @@ -206,7 +207,8 @@ packetsoutunc = 0; ioStatus = BytesNone; - strcpy(ifr.ifr_name, unitName); + strncpy(ifr.ifr_name, unitName, sizeof(ifr.ifr_name)); + ifr.ifr_name[sizeof(ifr.ifr_name)-1] = '\0'; if (ioctl(s, SIOCGIFADDR, &ifr) < 0) { } Index: kdenetwork/ksirc/servercontroller.cpp diff -u kdenetwork/ksirc/servercontroller.cpp:1.126 kdenetwork/ksirc/servercontroller.cpp:1.126.2.2 --- kdenetwork/ksirc/servercontroller.cpp:1.126 Thu Jun 21 17:28:58 2001 +++ kdenetwork/ksirc/servercontroller.cpp Fri Dec 6 17:12:51 2002 @@ -516,8 +516,8 @@ case ProcCommand::changeChannel: { char *new_s, *old_s; - new_s = new char[args.length()]; - old_s = new char[args.length()]; + new_s = new char[args.length()+1]; + old_s = new char[args.length()+1]; sscanf(args.ascii(), "%s %s", old_s, new_s); // If the channel has a !, it's a control channel, remove the ! if(old_s[0] == '!') Index: kdenetwork/ksirc/puke/controller.cpp diff -u kdenetwork/ksirc/puke/controller.cpp:1.46 kdenetwork/ksirc/puke/controller.cpp:1.46.2.1 --- kdenetwork/ksirc/puke/controller.cpp:1.46 Wed Mar 14 02:13:19 2001 +++ kdenetwork/ksirc/puke/controller.cpp Fri Dec 6 17:17:15 2002 @@ -567,7 +567,7 @@ int iParent=-1, iType=-1; char rand[50],name[50]; - int found = sscanf(pm->cArg, "%d\t%d\t%s\t%s", &iParent, &iType, rand, name); + int found = sscanf(pm->cArg, "%d\t%d\t%49s\t%49s", &iParent, &iType, rand, name); if(found != 4){ throw(errorCommandFailed(PUKE_INVALID,6)); } Index: kdenetwork/ktalkd/ktalkd/announce.cpp diff -u kdenetwork/ktalkd/ktalkd/announce.cpp:1.15 kdenetwork/ktalkd/ktalkd/announce.cpp:1.15.2.1 --- kdenetwork/ktalkd/ktalkd/announce.cpp:1.15 Wed Apr 4 16:33:30 2001 +++ kdenetwork/ktalkd/ktalkd/announce.cpp Tue May 21 23:02:41 2002 @@ -430,7 +430,7 @@ *(bptr++) = '\n'; } *bptr = '\0'; - fprintf(tf, big_buf); + fprintf(tf, "%s", big_buf); fflush(tf); ioctl(fileno(tf), TIOCNOTTY, (struct sgttyb *) 0); delete remotemach; Index: kdenetwork/ktalkd/ktalkd/readcfg++.cpp diff -u kdenetwork/ktalkd/ktalkd/readcfg++.cpp:1.21 kdenetwork/ktalkd/ktalkd/readcfg++.cpp:1.21.2.1 --- kdenetwork/ktalkd/ktalkd/readcfg++.cpp:1.21 Mon Jun 4 22:19:34 2001 +++ kdenetwork/ktalkd/ktalkd/readcfg++.cpp Fri Dec 13 11:32:05 2002 @@ -219,7 +219,7 @@ if (found("Announce3")) { qstrncpy(Options.announce3,result.local8Bit(),S_CFGLINE); } if (found("NEUUser")) { - qstrncpy(Options.NEU_user,result.local8Bit(),S_INVITE_LINES); + qstrncpy(Options.NEU_user,result.local8Bit(),S_CFGLINE); message("NEUUser = %s", Options.NEU_user); } if (found("NEUBehaviour")) { Index: kdenetwork/ktalkd/ktalkd/unixsock.cpp diff -u kdenetwork/ktalkd/ktalkd/unixsock.cpp:1.7 kdenetwork/ktalkd/ktalkd/unixsock.cpp:1.7.2.1 --- kdenetwork/ktalkd/ktalkd/unixsock.cpp:1.7 Wed Apr 4 16:33:30 2001 +++ kdenetwork/ktalkd/ktalkd/unixsock.cpp Wed May 22 01:13:56 2002 @@ -67,6 +67,9 @@ */ { + // WABA: Disabled for reasons outlined below by XXX. + return FALSE; +#if 0 // Create a socket int sock; if ((sock = socket (AF_UNIX, SOCK_DGRAM, 0)) < 0) return FALSE; @@ -142,4 +145,5 @@ unlink (tempAddr.sun_path); message("Announce to ktalk : result = %d",result); return result; +#endif } Index: kdenetwork/ktalkd/ktalkd/machines/talkconn.cpp diff -u kdenetwork/ktalkd/ktalkd/machines/talkconn.cpp:1.9 kdenetwork/ktalkd/ktalkd/machines/talkconn.cpp:1.9.6.1 --- kdenetwork/ktalkd/ktalkd/machines/talkconn.cpp:1.9 Sun Jan 9 03:18:04 2000 +++ kdenetwork/ktalkd/ktalkd/machines/talkconn.cpp Fri Dec 13 11:32:05 2002 @@ -88,9 +88,13 @@ *old_msg.r_tty = '\0'; strncpy(new_msg.l_name,local_user,NEW_NAME_SIZE); + new_msg.l_name[NEW_NAME_SIZE-1]='\0'; strncpy(new_msg.r_name,r_name,NEW_NAME_SIZE); + new_msg.r_name[NEW_NAME_SIZE-1]='\0'; strncpy(old_msg.l_name,local_user,OLD_NAME_SIZE); + old_msg.l_name[OLD_NAME_SIZE-1]='\0'; strncpy(old_msg.r_name,r_name,OLD_NAME_SIZE); + old_msg.r_name[OLD_NAME_SIZE-1]='\0'; } Index: kdenetwork/lanbrowsing/kio_lan/kio_lan.cpp diff -u kdenetwork/lanbrowsing/kio_lan/kio_lan.cpp:1.14.2.3 kdenetwork/lanbrowsing/kio_lan/kio_lan.cpp:1.14.2.6 --- kdenetwork/lanbrowsing/kio_lan/kio_lan.cpp:1.14.2.3 Wed Oct 24 01:33:54 2001 +++ kdenetwork/lanbrowsing/kio_lan/kio_lan.cpp Fri Dec 13 11:34:19 2002 @@ -259,7 +259,8 @@ //should never happen socketname+="???"; - strcpy(addr.sun_path,socketname); + strncpy(addr.sun_path,socketname,sizeof(addr.sun_path)); + addr.sun_path[sizeof(addr.sun_path)-1] = '\0'; int result=::connect(sockFD,(sockaddr*)&addr, sizeof(addr)); kdDebug(7101)<<"readDataFromServer(): result: "<