swami / libinstpatch

Instrument file software library.
Other
20 stars 6 forks source link

Fix variable used but not initialized. #39

Closed jjceresa closed 4 years ago

jjceresa commented 4 years ago

The variable emptybeing a function parameter, this PR fix a potential violation access.

Note: this was discovered by a compiler warning.

derselbst commented 4 years ago

No, sry. That won't work. Your change silently assumes that va_list is a pointer type. If va_list is a struct the build would break, see #31.

I've made that intentionally. It is save to use, because empty is not accessed in ipatch_convert_object_to_type_multi_set_vlist when the second last argument is NULL.

jjceresa commented 4 years ago

If va_list is a struct the build would break, see #31.

Oh sorry, I completely forgot about this case. I will revert this and propose a comment rather.

derselbst commented 4 years ago

Good idea!