[PATCH 2/5] plugin:python: check asprintf() errors

2017-04-23 Thread Federico Vaga
The code was validating the string but the man page for asprintf(3) says clearly: If memory allocation wasn't possible, or some other error occurs, these functions will return -1, and the contents of strp are undefined. So, we cannot really rely on the returned string pointer.

[PATCH 2/5] plugin:python: check asprintf() errors

2017-04-23 Thread Federico Vaga
The code was validating the string but the man page for asprintf(3) says clearly: If memory allocation wasn't possible, or some other error occurs, these functions will return -1, and the contents of strp are undefined. So, we cannot really rely on the returned string pointer.