password.c: Fixes to allow Win95 clients to have lm encrypted passwords
[samba.git] / source3 / rpc_parse / parse_misc.c
index 35ca6c9553cdb9237ac968cecc5b902c19b55c43..3c83382f0cbcd2c1cfa38164d6ed385ecc4c41f5 100644 (file)
@@ -369,13 +369,14 @@ creates a STRING2 structure.
 ********************************************************************/
 void make_string2(STRING2 *str, char *buf, int len)
 {
-       /* set up string lengths. */
-       str->str_max_len = len;
-       str->undoc       = 0;
-       str->str_str_len = len;
-
-       /* store the string */
-       memcpy(str->buffer, buf, len);
+  /* set up string lengths. */
+  str->str_max_len = len;
+  str->undoc       = 0;
+  str->str_str_len = len;
+
+  /* store the string */
+  if(len != 0)
+    memcpy(str->buffer, buf, len);
 }
 
 /*******************************************************************