mirror of
https://github.com/samba-team/samba.git
synced 2025-11-22 16:23:49 +03:00
r7516: make sure binary decoding gives us something we can run string functions on
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
12647e3722
commit
9913ab2550
@@ -136,7 +136,7 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *ctx, const char *str)
|
||||
struct ldb_val ret;
|
||||
int slen = strlen(str);
|
||||
|
||||
ret.data = talloc_size(ctx, slen);
|
||||
ret.data = talloc_size(ctx, slen+1);
|
||||
ret.length = 0;
|
||||
if (ret.data == NULL) return ret;
|
||||
|
||||
@@ -155,6 +155,7 @@ struct ldb_val ldb_binary_decode(TALLOC_CTX *ctx, const char *str)
|
||||
}
|
||||
}
|
||||
ret.length = j;
|
||||
((uint8_t *)ret.data)[j] = 0;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user