Hi James,
On 10/16/19 6:43 PM, James Prestwood wrote:
---
src/util.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util.c b/src/util.c
index f787ce6b..f1860a33 100644
--- a/src/util.c
+++ b/src/util.c
@@ -176,7 +176,7 @@ const char *util_get_domain(const char *identity)
strncpy(domain, identity, c - identity);
return domain;
case '@':
- strcpy(domain, c + 1);
+ strncpy(domain, c + 1, sizeof(domain));
Ah but the input is guaranteed to be less than 256 bytes anyway. But in
general, using strncpy isn't safe like that either as the target won't
be null terminated in some cases. Use l_strlcpy instead.
return domain;
default:
continue;
Regards,
-Denis