• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révision1270fac69d2f7e89161ccb780ce3b17466da34ea (tree)
l'heure2016-05-03 01:37:43
AuteurEli Zaretskii <eliz@gnu....>
CommiterEli Zaretskii

Message de Log

Fix startup on MS-Windows when 'gdb.ini' is found in $HOME

* windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one
error in allocation of space for "$HOME/.gdbinit" string. This
caused GDB to abort on startup whenever a '~/gdb.ini' file was
actually found, because xsnprintf would hit an assertion
violation.

Change Summary

Modification

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
1+2016-05-02 Eli Zaretskii <eliz@gnu.org>
2+
3+ * windows-nat.c (_initialize_check_for_gdb_ini): Fix off-by-one
4+ error in allocation of space for "$HOME/.gdbinit" string. This
5+ caused GDB to abort on startup whenever a '~/gdb.ini' file was
6+ actually found, because xsnprintf would hit an assertion
7+ violation.
8+
19 2016-04-28 Simon Marchi <simon.marchi@ericsson.com>
210
311 * cli/cli-decode.c (help_cmd_list): Do not list commands that
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2702,7 +2702,7 @@ _initialize_check_for_gdb_ini (void)
27022702 {
27032703 char *p;
27042704 char *oldini = (char *) alloca (strlen (homedir) +
2705- sizeof ("/gdb.ini"));
2705+ sizeof ("gdb.ini") + 1);
27062706 strcpy (oldini, homedir);
27072707 p = strchr (oldini, '\0');
27082708 if (p > oldini && !IS_DIR_SEPARATOR (p[-1]))
@@ -2711,9 +2711,9 @@ _initialize_check_for_gdb_ini (void)
27112711 if (access (oldini, 0) == 0)
27122712 {
27132713 int len = strlen (oldini);
2714- char *newini = (char *) alloca (len + 1);
2714+ char *newini = (char *) alloca (len + 2);
27152715
2716- xsnprintf (newini, len + 1, "%.*s.gdbinit",
2716+ xsnprintf (newini, len + 2, "%.*s.gdbinit",
27172717 (int) (len - (sizeof ("gdb.ini") - 1)), oldini);
27182718 warning (_("obsolete '%s' found. Rename to '%s'."), oldini, newini);
27192719 }