Skip to content
Snippets Groups Projects
Commit dac3e710 authored by Yao Qi's avatar Yao Qi
Browse files

Add null pointer check in ctf_xfer_partial

I find a gdb crash when gdb reads ctf trace.  The crash is caused by passing
NULL to strcmp.  This patch is to add null pointer check, as what we did
somewhere else in ctf.c.

gdb:

2014-04-19  Yao Qi  <yao@codesourcery.com>

	* ctf.c (ctf_xfer_partial): Check 'name' is NULL before strcmp.
parent 2bca57ba
No related branches found
No related tags found
No related merge requests found
2014-04-19 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_xfer_partial): Check 'name' is NULL before strcmp.
2014-04-18 Siva Chandra Reddy <sivachandra@google.com>
* valops.c (oload_method_static): Remove unnecessary argument
......
......@@ -1399,7 +1399,7 @@ ctf_xfer_partial (struct target_ops *ops, enum target_object object,
= bt_ctf_iter_read_event (ctf_iter);
const char *name = bt_ctf_event_name (event);
if (strcmp (name, "frame") == 0)
if (name == NULL || strcmp (name, "frame") == 0)
break;
else if (strcmp (name, "memory") != 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment