projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3bfb4d2
)
Limit memcpy to length
author
Alan T. DeKok
<aland@freeradius.org>
Sat, 7 Mar 2015 15:59:03 +0000
(10:59 -0500)
committer
Alan T. DeKok
<aland@freeradius.org>
Sat, 7 Mar 2015 15:59:03 +0000
(10:59 -0500)
src/lib/value.c
patch
|
blob
|
history
diff --git
a/src/lib/value.c
b/src/lib/value.c
index
bc56c81
..
0073734
100644
(file)
--- a/
src/lib/value.c
+++ b/
src/lib/value.c
@@
-447,9
+447,9
@@
ssize_t value_data_from_str(TALLOC_CTX *ctx, value_data_t *dst,
char const *q;
int x;
- dst->strvalue = p = talloc_memdup(ctx, src, len + 1);
+ dst->strvalue = p = talloc_array(ctx, char, len + 1);
+ memcpy(p, src, len);
p[len] = '\0';
- talloc_set_type(p, char);
/*
* No de-quoting. Just copy the string.