fix-Werror-format-security.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --- hplip-3.22.6/protocol/hp_ipp.c 2022-06-28 20:44:38.000000000 +0200
  2. +++ hplip-3.22.6/protocol/hp_ipp.c.new 2022-06-28 20:56:14.336097721 +0200
  3. @@ -110,7 +110,7 @@
  4. }
  5. if ( info == NULL )
  6. - snprintf( info,sizeof(info), name );
  7. + snprintf( info, sizeof(info), "%s", name );
  8. sprintf( printer_uri, "ipp://localhost/printers/%s", name );
  9. --- hplip-3.22.6/protocol/hp_ipp.c 2022-06-28 21:08:10.000000000 +0200
  10. +++ hplip-3.22.6/protocol/hp_ipp.c.new 2022-06-28 21:14:15.921484059 +0200
  11. @@ -511,27 +511,27 @@
  12. if ( strcmp(attr_name, "printer-name") == 0 &&
  13. val_tag == IPP_TAG_NAME ) {
  14. - snprintf(t_printer->name, sizeof(t_printer->name),ippGetString(attr, 0, NULL) );
  15. + snprintf(t_printer->name, sizeof(t_printer->name), "%s", ippGetString(attr, 0, NULL) );
  16. }
  17. else if ( strcmp(attr_name, "device-uri") == 0 &&
  18. val_tag == IPP_TAG_URI ) {
  19. - snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), ippGetString(attr, 0, NULL) );
  20. + snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), "%s", ippGetString(attr, 0, NULL) );
  21. }
  22. else if ( strcmp(attr_name, "printer-uri-supported") == 0 &&
  23. val_tag == IPP_TAG_URI ) {
  24. - snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), ippGetString(attr, 0, NULL) );
  25. + snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), "%s", ippGetString(attr, 0, NULL) );
  26. }
  27. else if ( strcmp(attr_name, "printer-info") == 0 &&
  28. val_tag == IPP_TAG_TEXT ) {
  29. - snprintf(t_printer->info,sizeof(t_printer->info), ippGetString(attr, 0, NULL) );
  30. + snprintf(t_printer->info,sizeof(t_printer->info), "%s", ippGetString(attr, 0, NULL) );
  31. }
  32. else if ( strcmp(attr_name, "printer-location") == 0 &&
  33. val_tag == IPP_TAG_TEXT ) {
  34. - snprintf(t_printer->location,sizeof(t_printer->location),ippGetString(attr, 0, NULL) );
  35. + snprintf(t_printer->location,sizeof(t_printer->location),"%s", ippGetString(attr, 0, NULL) );
  36. }
  37. else if ( strcmp(attr_name, "printer-make-and-model") == 0 &&
  38. val_tag == IPP_TAG_TEXT ) {
  39. - snprintf(t_printer->make_model,sizeof(t_printer->make_model),ippGetString(attr, 0, NULL) );
  40. + snprintf(t_printer->make_model,sizeof(t_printer->make_model),"%s", ippGetString(attr, 0, NULL) );
  41. }
  42. else if ( strcmp(attr_name, "printer-state") == 0 &&
  43. val_tag == IPP_TAG_ENUM ) {