Introduction
Introduction Statistics Contact Development Disclaimer Help
Use strcpy where we control the buffer size - geomyidae - A small C-based gophe…
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfri…
Log
Files
Refs
Tags
README
LICENSE
---
commit a86a1cbb6590aed14e144d5abde60205654324d8
parent 7ca184a99e81c3549a8a3d82ec7a201686cf3040
Author: Quentin Rameau <[email protected]>
Date: Thu, 30 Aug 2018 21:15:58 +0200
Use strcpy where we control the buffer size
Signed-off-by: Christoph Lohmann <[email protected]>
Diffstat:
M ind.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/ind.c b/ind.c
@@ -296,8 +296,8 @@ addelem(Elems *e, char *s)
e->num++;
e->e = xrealloc(e->e, sizeof(char *) * e->num);
- e->e[e->num - 1] = xcalloc(1, slen);
- strncpy(e->e[e->num - 1], s, slen - 1);
+ e->e[e->num - 1] = xmalloc(slen);
+ strcpy(e->e[e->num - 1], s);
return;
}
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.