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:
b'Holger Vogt 2024-07-16 07:35:20 +00:00
commit 0721afc355
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ char *dup_string(const char *str, size_t n_char)
char *p = TMALLOC(char, n_char + 1);
if (p != NULL) {
(void) memcpy(p, str, n_char + 1);
(void) memcpy(p, str, n_char);
p[n_char] = '\0';
}
return p;