summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-04-16 22:55:39 +0000
committerAndrew Tridgell <tridge@samba.org>2002-04-16 22:55:39 +0000
commit7c0301d100885f3d4ee48a973158d1aa0036af1c (patch)
tree50dddec569fa6bdc6dacc7dae716b09905f4ad7e /source3
parenta32940d53e127bb7d46a4d46d24a53b17a23a8a4 (diff)
downloadsamba-7c0301d100885f3d4ee48a973158d1aa0036af1c.tar.gz
samba-7c0301d100885f3d4ee48a973158d1aa0036af1c.tar.bz2
samba-7c0301d100885f3d4ee48a973158d1aa0036af1c.zip
stricter conditions on termination in strings
this was a very nasty bug with filename corruption and NT4 clients. The exact termination conditions are quite critical ... (This used to be commit a538efe7d00e7a61df194ca1c22e0583dcbb7a4a)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/charcnv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 803cda36c8..cd32779594 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -356,9 +356,9 @@ int pull_ascii(char *dest, const void *src, int dest_len, int src_len, int flags
if (flags & STR_TERMINATE) {
if (src_len == -1) {
- src_len = strlen(src)+1;
+ src_len = strlen(src);
} else {
- src_len = strnlen(src, src_len) + 1;
+ src_len = strnlen(src, src_len);
}
}
@@ -551,9 +551,9 @@ int pull_ucs2(const void *base_ptr, char *dest, const void *src, int dest_len, i
if (flags & STR_TERMINATE) {
if (src_len == -1) {
- src_len = strlen_w(src)*2+2;
+ src_len = strlen_w(src)*2;
} else {
- src_len = strnlen_w(src, src_len/2)*2+2;
+ src_len = strnlen_w(src, src_len/2)*2;
}
}
@@ -623,9 +623,9 @@ int pull_utf8(char *dest, const void *src, int dest_len, int src_len, int flags)
if (flags & STR_TERMINATE) {
if (src_len == -1) {
- src_len = strlen(src)+1;
+ src_len = strlen(src);
} else {
- src_len = strnlen(src, src_len) + 1;
+ src_len = strnlen(src, src_len);
}
}