mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 19:50:24 +02:00
* symbols.c (scm_gensym): Fix buffer overrun (try `(gensym
(make-string 2000 #\!))' in an older version). Change strncpy to memcpy to allow embedded NUL characters in symbol prefix.
This commit is contained in:
parent
24ecf16c0c
commit
8d09eb0449
2 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2001-05-28 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||||
|
|
||||||
|
* symbols.c (scm_gensym): Fix buffer overrun (try `(gensym
|
||||||
|
(make-string 2000 #\!))' in an older version).
|
||||||
|
|
||||||
|
Change strncpy to memcpy to allow embedded NUL characters in
|
||||||
|
symbol prefix.
|
||||||
|
|
||||||
2001-05-28 Michael Livshin <mlivshin@bigfoot.com>
|
2001-05-28 Michael Livshin <mlivshin@bigfoot.com>
|
||||||
|
|
||||||
* hooks.c (scm_create_hook): deprecated.
|
* hooks.c (scm_create_hook): deprecated.
|
||||||
|
|
|
@ -247,8 +247,8 @@ SCM_DEFINE (scm_gensym, "gensym", 0, 1, 0,
|
||||||
SCM_VALIDATE_STRING (1, prefix);
|
SCM_VALIDATE_STRING (1, prefix);
|
||||||
len = SCM_STRING_LENGTH (prefix);
|
len = SCM_STRING_LENGTH (prefix);
|
||||||
if (len > MAX_PREFIX_LENGTH)
|
if (len > MAX_PREFIX_LENGTH)
|
||||||
name = SCM_MUST_MALLOC (MAX_PREFIX_LENGTH + SCM_INTBUFLEN);
|
name = SCM_MUST_MALLOC (len + SCM_INTBUFLEN);
|
||||||
strncpy (name, SCM_STRING_CHARS (prefix), len);
|
memcpy (name, SCM_STRING_CHARS (prefix), len);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]);
|
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue