Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/lib/libperfuse Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/78409193f788
branches: netbsd-7
changeset: 798577:78409193f788
user: martin <martin%NetBSD.org@localhost>
date: Fri Nov 14 15:06:36 2014 +0000
description:
Pull up following revision(s) (requested by manu in ticket #231):
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 e9044a5bd321 -r 78409193f788 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c Fri Nov 14 15:01:02 2014 +0000
+++ b/lib/libperfuse/ops.c Fri Nov 14 15:06:36 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ops.c,v 1.66.2.12 2014/11/09 10:06:34 msaitoh Exp $ */
+/* $NetBSD: ops.c,v 1.66.2.13 2014/11/14 15:06:36 martin Exp $ */
/*-
* Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -3460,6 +3460,7 @@
perfuse_msg_t *pm;
struct fuse_setxattr_in *fsi;
size_t attrnamelen;
+ size_t datalen;
size_t len;
char *np;
int error;
@@ -3472,23 +3473,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