Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
38c54d9d
Commit
38c54d9d
authored
Sep 22, 2010
by
Juanma Barranquero
Browse files
src/w32.c (get_emacs_configuration_options): Fix buffer overrun.
parent
8f978ca0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
src/ChangeLog
src/ChangeLog
+5
-0
src/w32.c
src/w32.c
+30
-13
No files found.
src/ChangeLog
View file @
38c54d9d
2010-09-22 Juanma Barranquero <lekktu@gmail.com>
Eli Zaretskii <eliz@gnu.org>
* w32.c (get_emacs_configuration_options): Fix buffer overrun.
2010-09-22 Eli Zaretskii <eliz@gnu.org>
* minibuf.c (Fminibuffer_contents)
...
...
src/w32.c
View file @
38c54d9d
...
...
@@ -1925,7 +1925,25 @@ get_emacs_configuration (void)
char *
get_emacs_configuration_options (void)
{
static
char
options_buffer
[
256
];
static char *options_buffer;
char cv[32]; /* Enough for COMPILER_VERSION. */
char *options[] = {
cv, /* To be filled later. */
#ifdef EMACSDEBUG
" --no-opt",
#endif
/* configure.bat already sets USER_CFLAGS and USER_LDFLAGS
with a starting space to save work here. */
#ifdef USER_CFLAGS
" --cflags", USER_CFLAGS,
#endif
#ifdef USER_LDFLAGS
" --ldflags", USER_LDFLAGS,
#endif
NULL
};
size_t size = 0;
int i;
/* Work out the effective configure options for this build. */
#ifdef _MSC_VER
...
...
@@ -1938,18 +1956,17 @@ get_emacs_configuration_options (void)
#endif
#endif
sprintf
(
options_buffer
,
COMPILER_VERSION
);
#ifdef EMACSDEBUG
strcat
(
options_buffer
,
" --no-opt"
);
#endif
#ifdef USER_CFLAGS
strcat
(
options_buffer
,
" --cflags"
);
strcat
(
options_buffer
,
USER_CFLAGS
);
#endif
#ifdef USER_LDFLAGS
strcat
(
options_buffer
,
" --ldflags"
);
strcat
(
options_buffer
,
USER_LDFLAGS
);
#endif
if (_snprintf (cv, sizeof (cv), COMPILER_VERSION) < 0)
return "Error: not enough space for compiler version";
for (i = 0; options[i]; i++)
size += strlen (options[i]);
options_buffer = xmalloc (size + 1);
for (i = 0; options[i]; i++)
strcat (options_buffer, options[i]);
return options_buffer;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment