format_string.patch 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. Index: iptraf-3.0.0/src/othptab.c
  2. ===================================================================
  3. --- iptraf-3.0.0.orig/src/othptab.c
  4. +++ iptraf-3.0.0/src/othptab.c
  5. @@ -335,7 +335,7 @@ void printothpentry(struct othptable *ta
  6. break;
  7. }
  8. - sprintf(scratchpad, inet_ntoa(saddr));
  9. + sprintf(scratchpad, "%s", inet_ntoa(saddr));
  10. strcat(msgstring, scratchpad);
  11. wattrset(table->othpwin, ARPATTR);
  12. break;
  13. @@ -354,7 +354,7 @@ void printothpentry(struct othptable *ta
  14. break;
  15. }
  16. - sprintf(scratchpad, rarp_mac_addr);
  17. + sprintf(scratchpad, "%s", rarp_mac_addr);
  18. strcat(msgstring, scratchpad);
  19. wattrset(table->othpwin, ARPATTR);
  20. break;
  21. @@ -421,7 +421,7 @@ void printothpentry(struct othptable *ta
  22. wattrset(table->othpwin, UNKNIPATTR);
  23. protptr = getprotobynumber(entry->protocol);
  24. if (protptr != NULL) {
  25. - sprintf(protname, protptr->p_aliases[0]);
  26. + sprintf(protname, "%s", protptr->p_aliases[0]);
  27. } else {
  28. sprintf(protname, "IP protocol");
  29. unknown = 1;