110-fix_sscanf_alloc.patch 671 B

1234567891011121314151617181920
  1. --- a/trace-util.c
  2. +++ b/trace-util.c
  3. @@ -110,7 +110,7 @@ void parse_cmdlines(struct pevent *peven
  4. line = strtok_r(file, "\n", &next);
  5. while (line) {
  6. - sscanf(line, "%d %as", &pid,
  7. + sscanf(line, "%d %ms", &pid,
  8. (float *)(void *)&comm); /* workaround gcc warning */
  9. pevent_register_comm(pevent, comm, pid);
  10. free(comm);
  11. @@ -133,7 +133,7 @@ void parse_proc_kallsyms(struct pevent *
  12. line = strtok_r(file, "\n", &next);
  13. while (line) {
  14. mod = NULL;
  15. - ret = sscanf(line, "%as %c %as\t[%as",
  16. + ret = sscanf(line, "%ms %c %ms\t[%ms",
  17. (float *)(void *)&addr_str, /* workaround gcc warning */
  18. &ch,
  19. (float *)(void *)&func,