diff options
author | joerg <joerg@FreeBSD.org> | 1996-10-28 23:02:38 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-10-28 23:02:38 +0000 |
commit | e9e54bcde4c77ac5866b3bb5a79e93ed3c103d6c (patch) | |
tree | 4f5c6c35369a31e68ed1f6966e80a9fab6c39eef /usr.sbin | |
parent | 8bb207082c2a8419851a3a4dba80c9c455bc25e5 (diff) | |
download | FreeBSD-src-e9e54bcde4c77ac5866b3bb5a79e93ed3c103d6c.zip FreeBSD-src-e9e54bcde4c77ac5866b3bb5a79e93ed3c103d6c.tar.gz |
Do not modify a malloc()ed pointer; instead, use memmove().
Detected by: phkmalloc - AJ :)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/inetd/inetd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c index 96fc290..72d9bbd 100644 --- a/usr.sbin/inetd/inetd.c +++ b/usr.sbin/inetd/inetd.c @@ -40,7 +40,7 @@ static char copyright[] = #ifndef lint /* from: @(#)inetd.c 8.4 (Berkeley) 4/13/94"; */ static char inetd_c_rcsid[] = - "$Id: inetd.c,v 1.12 1996/07/17 15:00:28 davidg Exp $"; + "$Id: inetd.c,v 1.13 1996/08/09 22:20:24 julian Exp $"; #endif /* not lint */ /* @@ -926,7 +926,8 @@ more: sep->se_socktype = -1; sep->se_proto = newstr(sskip(&cp)); if (strncmp(sep->se_proto, "rpc/", 4) == 0) { - sep->se_proto += 4; + memmove(sep->se_proto, sep->se_proto + 4, + strlen(sep->se_proto) + 1 - 4); sep->se_rpc = 1; sep->se_rpc_prog = sep->se_rpc_lowvers = sep->se_rpc_lowvers = 0; |