projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2839a5
)
* ch-valprint.c (chill_val_print): To avoid segfaults, don't print
author
Jim Blandy
<jimb@codesourcery.com>
Wed, 10 Dec 1997 22:58:21 +0000
(22:58 +0000)
committer
Jim Blandy
<jimb@codesourcery.com>
Wed, 10 Dec 1997 22:58:21 +0000
(22:58 +0000)
a string whose dynamic length is longer than its static length.
gdb/ch-valprint.c
patch
|
blob
|
history
diff --git
a/gdb/ch-valprint.c
b/gdb/ch-valprint.c
index 796172fb1733f8c85442d77a069709b442072445..911c693f3c0e8ca5163fe2e3089076949aa66685 100644
(file)
--- a/
gdb/ch-valprint.c
+++ b/
gdb/ch-valprint.c
@@
-422,11
+422,15
@@
chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
switch (TYPE_CODE (inner))
{
case TYPE_CODE_STRING:
- if (length > TYPE_LENGTH (type))
+ if (length > TYPE_LENGTH (type)
- 2
)
{
fprintf_filtered (stream,
- "<dynamic length %ld > static length %d>",
+ "<dynamic length %ld > static length %d>
*invalid*
",
length, TYPE_LENGTH (type));
+
+ /* Don't print the string; doing so might produce a
+ segfault. */
+ return length;
}
LA_PRINT_STRING (stream, data_addr, length, 0);
return length;