Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/lib/libperfuse Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/7d15b00351ac
branches: netbsd-6
changeset: 776795:7d15b00351ac
user: snj <snj%NetBSD.org@localhost>
date: Tue Dec 02 22:01:37 2014 +0000
description:
Pull up following revision(s) (requested by manu in ticket #1193):
lib/libperfuse/ops.c: revision 1.81
Allow setxattr to be called with a NULL value, instead of crashing.
diffstat:
lib/libperfuse/ops.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diffs (49 lines):
diff -r 06fea4d168d1 -r 7d15b00351ac lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c Tue Dec 02 21:56:37 2014 +0000
+++ b/lib/libperfuse/ops.c Tue Dec 02 22:01:37 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.c,v 1.50.2.18 2014/11/09 11:03:41 msaitoh Exp $ */
+/* $NetBSD: ops.c,v 1.50.2.19 2014/12/02 22:01:37 snj Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -3450,6 +3450,7 @@
perfuse_msg_t *pm;
struct fuse_setxattr_in *fsi;
size_t attrnamelen;
+ size_t datalen;
size_t len;
char *np;
int error;
@@ -3462,23 +3463,27 @@
ps = puffs_getspecific(pu);
attrname = perfuse_native_ns(attrns, attrname, fuse_attrname);
attrnamelen = strlen(attrname) + 1;
- len = sizeof(*fsi) + attrnamelen + *resid;
+
+ datalen = (resid != NULL) ? *resid : 0;
+ len = sizeof(*fsi) + attrnamelen + datalen;
pm = ps->ps_new_msg(pu, opc, FUSE_SETXATTR, len, pcr);
fsi = GET_INPAYLOAD(ps, pm, fuse_setxattr_in);
- fsi->size = (unsigned int)*resid;
+ fsi->size = (unsigned int)datalen;
fsi->flags = 0;
np = (char *)(void *)(fsi + 1);
(void)strlcpy(np, attrname, attrnamelen);
np += attrnamelen;
- (void)memcpy(np, (char *)attr, *resid);
+ if (datalen)
+ (void)memcpy(np, (char *)attr, datalen);
if ((error = xchg_msg(pu, opc, pm,
NO_PAYLOAD_REPLY_LEN, wait_reply)) != 0)
goto out;
ps->ps_destroy_msg(pm);
- *resid = 0;
+ if (resid)
+ *resid = 0;
error = 0;
out:
Home |
Main Index |
Thread Index |
Old Index