PATCH: libiberty/cp-demangle.c, guard against null

msnyder
2007-08-01T01:44:31Z

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]

[-- Attachment #2: 18.txt --]
[-- Type: text/plain, Size: 775 bytes --]

2007-07-31 Michael Snyder <msnyder@access-company.com>

* cp-demangle.c (d_print_comp): Guard against null.

Index: cp-demangle.c
===================================================================
RCS file: /cvs/src/src/libiberty/cp-demangle.c,v
retrieving revision 1.67
diff -p -r1.67 cp-demangle.c
*** cp-demangle.c 6 May 2007 00:25:11 -0000 1.67
--- cp-demangle.c 1 Aug 2007 01:41:03 -0000
*************** d_print_comp (struct d_print_info *dpi,
*** 2912,2917 ****
--- 2912,2923 ----
typed_name = d_left (typed_name);
}

+ if (typed_name == NULL)
+ {
+ d_print_error (dpi);
+ return;
+ }
+
/* If typed_name is a template, then it applies to the
function type as well. */
if (typed_name->type == DEMANGLE_COMPONENT_TEMPLATE)