public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb] fix unsigned overflow in charset.c
@ 2018-10-09 17:19 Paul Koning
  2018-10-09 17:31 ` Pedro Alves
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Koning @ 2018-10-09 17:19 UTC (permalink / raw)
  To: gdb-patches

This fixed an overflow in pointer arithmetic that crashes GDB on Mac OS.

Ok for trunk?

	paul

gdb/ChangeLog:

2018-10-09  Paul Koning  <paul_koning@dell.com>

	* charset.c (convert_between_encodings): Fix unsigned overflow.

diff --git a/gdb/charset.c b/gdb/charset.c
index 8bb2b4d669..64757ab279 100644
--- a/gdb/charset.c
+++ b/gdb/charset.c
@@ -548,7 +548,7 @@ convert_between_encodings (const char *from, const char *to,
 
       /* Now make sure that the object on the obstack only includes
 	 bytes we have converted.  */
-      obstack_blank_fast (output, -outleft);
+      obstack_blank_fast (output, -(ssize_t) outleft);
 
       if (r == (size_t) -1)
 	{

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-10-17 23:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 17:19 [PATCH][gdb] fix unsigned overflow in charset.c Paul Koning
2018-10-09 17:31 ` Pedro Alves
2018-10-09 17:40   ` Paul Koning
2018-10-09 17:57     ` John Baldwin
2018-10-09 18:10       ` Paul Koning
2018-10-09 19:58         ` John Baldwin
2018-10-10  8:51           ` Pedro Alves
2018-10-11 20:16             ` John Baldwin
2018-10-16 15:58               ` Pedro Alves
2018-10-17 18:38                 ` John Baldwin
2018-10-17 18:47                   ` Paul Koning
2018-10-17 21:51                     ` Pedro Alves
2018-10-17 23:28                       ` Paul Koning

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).