Package: metastore / 1+20080623+debian-5

04-novalue-xattr.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Don't attempt to write a zero-length string to the store file when an
entry has an xattr without value.

--- a/metaentry.c
+++ b/metaentry.c
@@ -401,8 +401,9 @@
 			for (i = 0; i < mentry->xattrs; i++) {
 				write_string(mentry->xattr_names[i], to);
 				write_int(mentry->xattr_lvalues[i], 4, to);
-				write_binary_string(mentry->xattr_values[i],
-						    mentry->xattr_lvalues[i], to);
+				if (mentry->xattr_lvalues[i])
+					write_binary_string(mentry->xattr_values[i],
+							    mentry->xattr_lvalues[i], to);
 			}
 		}
 	}