Merge /u/mtasaka/ngspice/ branch asan-segv-fix into pre-master-44
https://sourceforge.net/p/ngspice/ngspice/merge-requests/19/
This commit is contained in:
commit
0721afc355
|
|
@ -78,7 +78,7 @@ char *dup_string(const char *str, size_t n_char)
|
||||||
char *p = TMALLOC(char, n_char + 1);
|
char *p = TMALLOC(char, n_char + 1);
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
(void) memcpy(p, str, n_char + 1);
|
(void) memcpy(p, str, n_char);
|
||||||
p[n_char] = '\0';
|
p[n_char] = '\0';
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue