public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [ob/pushed+7.11 1/2] Remove gdb/python/python.c code that handles strlen failing with -1
Date: Tue, 03 May 2016 11:22:00 -0000	[thread overview]
Message-ID: <1462274511-2554-1-git-send-email-palves@redhat.com> (raw)

This makes no sense -- strlen doesn't really ever fail with -1.

gdb/ChangeLog:
2016-05-03  Pedro Alves <palves@redhat.com>

	* python/python.c (_initialize_python) [IS_PY3K]: Remove dead
	code.
---
 gdb/ChangeLog       | 5 +++++
 gdb/python/python.c | 5 -----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 05e5c40..c5b7325 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-03  Pedro Alves <palves@redhat.com>
+
+	* python/python.c (_initialize_python) [IS_PY3K]: Remove dead
+	code.
+
 2016-05-03  Pedro Alves  <palves@redhat.com>
 
 	* configure.ac (PYTHON_LIBS): Sed away "-Xlinker -export-dynamic".
diff --git a/gdb/python/python.c b/gdb/python/python.c
index b90e5e5..ea9cf85 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1711,11 +1711,6 @@ message == an error message without a stack will be printed."),
   oldloc = setlocale (LC_ALL, NULL);
   setlocale (LC_ALL, "");
   progsize = strlen (progname);
-  if (progsize == (size_t) -1)
-    {
-      fprintf (stderr, "Could not convert python path to string\n");
-      return;
-    }
   progname_copy = (wchar_t *) PyMem_Malloc ((progsize + 1) * sizeof (wchar_t));
   if (!progname_copy)
     {
-- 
2.5.5

             reply	other threads:[~2016-05-03 11:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03 11:22 Pedro Alves [this message]
2016-05-03 11:22 ` [ob/pushed+7.11 2/2] Fix gdb/python/python.c use-after-free Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462274511-2554-1-git-send-email-palves@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).