diff options
| author | christos <christos@NetBSD.org> | 1997-04-17 17:29:24 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 1997-04-17 17:29:24 +0000 |
| commit | 57c6bc4254d19cb4d096144f072aaf8fe379052d (patch) | |
| tree | 83fb22149ebb870cc2c35493deeb11cca03df6ef /lib/librpcsvc | |
| parent | 062f26f33b64c97978b3709613d1ea9150b87fd0 (diff) | |
- Don't use ut_line, when you mean ut_name [does not matter really because
(sizeof(ut_line) == sizeof(ut_name)].
- Don't free bogus memory. xdr_bytes when is called with a non-null array
pointer, it tries to free it. We are passing real arrays to xdr_bytes,
so we really don't want to call free on them.
Diffstat (limited to 'lib/librpcsvc')
| -rw-r--r-- | lib/librpcsvc/rnusers.x | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/librpcsvc/rnusers.x b/lib/librpcsvc/rnusers.x index 0d5aff203bc..0b9eb0b0606 100644 --- a/lib/librpcsvc/rnusers.x +++ b/lib/librpcsvc/rnusers.x @@ -35,7 +35,7 @@ %#ifndef lint %/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/ %/*static char sccsid[] = "from: @(#)rnusers.x 2.1 88/08/01 4.0 RPCSRC";*/ -%static char rcsid[] = "$NetBSD: rnusers.x,v 1.3 1996/12/02 06:51:11 mikel Exp $"; +%static char rcsid[] = "$NetBSD: rnusers.x,v 1.4 1997/04/17 17:29:24 christos Exp $"; %#endif /* not lint */ #endif @@ -115,13 +115,20 @@ % char *ptr; % int size; % +% +% /* +% * We are using a non-malloc allocated array, +% * so we are not supposed to call xdr_free with it. +% */ +% if (xdrs->x_op == XDR_FREE) +% return (TRUE); % ptr = objp->ut_line; % size = sizeof(objp->ut_line); % if (!xdr_bytes(xdrs, &ptr, &size, size)) { % return (FALSE); % } % ptr = objp->ut_name; -% size = sizeof(objp->ut_line); +% size = sizeof(objp->ut_name); % if (!xdr_bytes(xdrs, &ptr, &size, size)) { % return (FALSE); % } |
