summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ppp/arp.c4
-rw-r--r--usr.sbin/ppp/chat.c4
-rw-r--r--usr.sbin/ppp/command.c8
-rw-r--r--usr.sbin/ppp/defs.c4
-rw-r--r--usr.sbin/ppp/iplist.c4
-rw-r--r--usr.sbin/ppp/modem.c8
6 files changed, 16 insertions, 16 deletions
diff --git a/usr.sbin/ppp/arp.c b/usr.sbin/ppp/arp.c
index dc9c7f3..d089e7c 100644
--- a/usr.sbin/ppp/arp.c
+++ b/usr.sbin/ppp/arp.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: arp.c,v 1.17 1997/11/09 06:22:38 brian Exp $
+ * $Id: arp.c,v 1.18 1997/11/22 03:37:22 brian Exp $
*
*/
@@ -244,7 +244,7 @@ get_ether_addr(int s, u_long ipaddr, struct sockaddr_dl *hwaddr)
for (ifr = ifc.ifc_req; ifr < ifend;) {
if (ifr->ifr_addr.sa_family == AF_INET) {
ina = ((struct sockaddr_in *) & ifr->ifr_addr)->sin_addr.s_addr;
- strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name));
+ strncpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name) - 1);
ifreq.ifr_name[sizeof(ifreq.ifr_name) - 1] = '\0';
/*
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index 5026c37..37f5776 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -18,7 +18,7 @@
* Columbus, OH 43221
* (614)451-1883
*
- * $Id: chat.c,v 1.39 1997/11/22 03:37:26 brian Exp $
+ * $Id: chat.c,v 1.40 1997/12/18 01:10:12 brian Exp $
*
* TODO:
* o Support more UUCP compatible control sequences.
@@ -186,7 +186,7 @@ ExpandString(const char *str, char *result, int reslen, int sendmode)
case 'T':
if (VarAltPhone == NULL) {
if (VarNextPhone == NULL) {
- strncpy(VarPhoneCopy, VarPhoneList, sizeof(VarPhoneCopy));
+ strncpy(VarPhoneCopy, VarPhoneList, sizeof(VarPhoneCopy) - 1);
VarPhoneCopy[sizeof(VarPhoneCopy) - 1] = '\0';
VarNextPhone = VarPhoneCopy;
}
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 6816936..aad66d8 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: command.c,v 1.115 1997/12/19 18:11:05 brian Exp $
+ * $Id: command.c,v 1.116 1997/12/21 03:16:09 brian Exp $
*
*/
#include <sys/param.h>
@@ -766,7 +766,7 @@ RunCommand(int argc, char const *const *argv, const char *label)
*buf = '\0';
if (label) {
- strncpy(buf, label, sizeof buf);
+ strncpy(buf, label, sizeof(buf) - 3);
buf[sizeof(buf)-3] = '\0';
strcat(buf, ": ");
}
@@ -999,7 +999,7 @@ SetServer(struct cmdargs const *arg)
if (passwd == NULL)
VarHaveLocalAuthKey = 0;
else {
- strncpy(VarLocalAuthKey, passwd, sizeof VarLocalAuthKey);
+ strncpy(VarLocalAuthKey, passwd, sizeof(VarLocalAuthKey) - 1);
VarLocalAuthKey[sizeof VarLocalAuthKey - 1] = '\0';
VarHaveLocalAuthKey = 1;
}
@@ -1360,7 +1360,7 @@ SetVariable(struct cmdargs const *arg)
case VAR_PHONE:
strncpy(VarPhoneList, argp, sizeof(VarPhoneList) - 1);
VarPhoneList[sizeof(VarPhoneList) - 1] = '\0';
- strncpy(VarPhoneCopy, VarPhoneList, sizeof(VarPhoneCopy));
+ strncpy(VarPhoneCopy, VarPhoneList, sizeof(VarPhoneCopy) - 1);
VarPhoneCopy[sizeof(VarPhoneCopy) - 1] = '\0';
VarNextPhone = VarPhoneCopy;
VarAltPhone = NULL;
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c
index d518c18..3bad88b 100644
--- a/usr.sbin/ppp/defs.c
+++ b/usr.sbin/ppp/defs.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: defs.c,v 1.6 1997/12/21 12:11:05 brian Exp $
*/
#include <sys/param.h>
@@ -56,7 +56,7 @@ void
SetLabel(const char *label)
{
if (label)
- strncpy(dstsystem, label, sizeof dstsystem);
+ strncpy(dstsystem, label, sizeof(dstsystem) - 1);
else
*dstsystem = '\0';
}
diff --git a/usr.sbin/ppp/iplist.c b/usr.sbin/ppp/iplist.c
index 84c2c76..e74add7 100644
--- a/usr.sbin/ppp/iplist.c
+++ b/usr.sbin/ppp/iplist.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: iplist.c,v 1.2 1997/12/21 12:11:06 brian Exp $
*/
#include <sys/types.h>
@@ -149,7 +149,7 @@ iplist_next(struct iplist *list)
int
iplist_setsrc(struct iplist *list, const char *src)
{
- strncpy(list->src, src, sizeof(list->src));
+ strncpy(list->src, src, sizeof(list->src)-1);
list->src[sizeof(list->src)-1] = '\0';
list->cur.srcptr = list->src;
do {
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c
index bca7943..d5996c9 100644
--- a/usr.sbin/ppp/modem.c
+++ b/usr.sbin/ppp/modem.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: modem.c,v 1.68 1997/12/18 01:10:13 brian Exp $
+ * $Id: modem.c,v 1.69 1997/12/21 03:16:12 brian Exp $
*
* TODO:
*/
@@ -466,12 +466,12 @@ OpenModem()
return modem = 0;
}
} else {
- strncpy(tmpDeviceList, VarDeviceList, sizeof(tmpDeviceList));
+ strncpy(tmpDeviceList, VarDeviceList, sizeof(tmpDeviceList)-1);
tmpDeviceList[sizeof(tmpDeviceList)-1] = '\0';
for(tmpDevice=strtok(tmpDeviceList, ","); tmpDevice && (modem < 0);
tmpDevice=strtok(NULL,",")) {
- strncpy(VarDevice, tmpDevice, sizeof(VarDevice));
+ strncpy(VarDevice, tmpDevice, sizeof(VarDevice)-1);
VarDevice[sizeof(VarDevice)-1]= '\0';
VarBaseDevice = strrchr(VarDevice, '/');
VarBaseDevice = VarBaseDevice ? VarBaseDevice + 1 : "";
@@ -700,7 +700,7 @@ HangupModem(int flag)
if (modem >= 0) {
char ScriptBuffer[SCRIPT_LEN];
- strncpy(ScriptBuffer, VarHangupScript, sizeof(ScriptBuffer));
+ strncpy(ScriptBuffer, VarHangupScript, sizeof(ScriptBuffer)-1);
ScriptBuffer[sizeof(ScriptBuffer) - 1] = '\0';
LogPrintf(LogDEBUG, "HangupModem: Script: %s\n", ScriptBuffer);
if (flag || !(mode & MODE_DEDICATED)) {
OpenPOWER on IntegriCloud