Skip to contentSkip to conversation

Fixed a dangling pointer

PATCH In review Ondřej Lysoněk <olysonek at redhat.com> 2 participants 2 messages Aug 24, 2016 – Aug 26, 2016

lore
Share & tools
lore

Ondřej Lysoněk <olysonek at redhat.com>

#0 lore raw

PATCH 1/1 Fixed a dangling pointer

---
 traceevent/parse-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
traceevent/parse-filter.c +1 -1
index 2500e75..ec308ae 100644
@@ -1720,7 +1720,7 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r
 	struct pevent *pevent;
 	unsigned long long addr;
 	const char *val = NULL;
-	char hex[64];
+	static char hex[64];
 
 	/* If the field is not a string convert it */
 	if (arg->str.field->flags & FIELD_IS_STRING) {
Signature · 1 line
2.5.5
#1 lore raw
Quoted 9 lines · On Wed, 24 Aug 2016 14:11:51 +0200 Ondřej Lysoněk <olysonek(a)redhat.com> wrote:
---
 traceevent/parse-filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
traceevent/parse-filter.c +0 -0
index 2500e75..ec308ae 100644

traceevent/parse-filter.c static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r · line 1726

Quoted 8 lines
traceevent/parse-filter.c +1 -1
@@ -1720,7 +1720,7 @@ static const char *get_field_str(struct filter_arg *arg, struct pevent_record *r
 	struct pevent *pevent;
 	unsigned long long addr;
 	const char *val = NULL;
-	char hex[64];
+	static char hex[64];
 
 	/* If the field is not a string convert it */
 	if (arg->str.field->flags & FIELD_IS_STRING) {

Thanks for the contribution! Commit message updated with my Acked-by. Pushed.
ea5c67865415 Fixed a dangling pointer