archrelease: copy trunk to staging-x86_64
[arch-packages.git] / hplip / trunk / 0025_fix-Werror-format-security.patch
blob86154afcdb08a2891531f98a0bea354d1d8e8ac1
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 @@
6 if ( info == NULL )
7 - snprintf( info,sizeof(info), name );
8 + snprintf( info, sizeof(info), "%s", name );
10 sprintf( printer_uri, "ipp://localhost/printers/%s", name );
12 --- hplip-3.22.6/protocol/hp_ipp.c 2022-06-28 21:08:10.000000000 +0200
13 +++ hplip-3.22.6/protocol/hp_ipp.c.new 2022-06-28 21:14:15.921484059 +0200
14 @@ -511,27 +511,27 @@
16 if ( strcmp(attr_name, "printer-name") == 0 &&
17 val_tag == IPP_TAG_NAME ) {
18 - snprintf(t_printer->name, sizeof(t_printer->name),ippGetString(attr, 0, NULL) );
19 + snprintf(t_printer->name, sizeof(t_printer->name), "%s", ippGetString(attr, 0, NULL) );
21 else if ( strcmp(attr_name, "device-uri") == 0 &&
22 val_tag == IPP_TAG_URI ) {
23 - snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), ippGetString(attr, 0, NULL) );
24 + snprintf(t_printer->device_uri,sizeof(t_printer->device_uri), "%s", ippGetString(attr, 0, NULL) );
26 else if ( strcmp(attr_name, "printer-uri-supported") == 0 &&
27 val_tag == IPP_TAG_URI ) {
28 - snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), ippGetString(attr, 0, NULL) );
29 + snprintf(t_printer->printer_uri,sizeof(t_printer->printer_uri), "%s", ippGetString(attr, 0, NULL) );
31 else if ( strcmp(attr_name, "printer-info") == 0 &&
32 val_tag == IPP_TAG_TEXT ) {
33 - snprintf(t_printer->info,sizeof(t_printer->info), ippGetString(attr, 0, NULL) );
34 + snprintf(t_printer->info,sizeof(t_printer->info), "%s", ippGetString(attr, 0, NULL) );
36 else if ( strcmp(attr_name, "printer-location") == 0 &&
37 val_tag == IPP_TAG_TEXT ) {
38 - snprintf(t_printer->location,sizeof(t_printer->location),ippGetString(attr, 0, NULL) );
39 + snprintf(t_printer->location,sizeof(t_printer->location),"%s", ippGetString(attr, 0, NULL) );
41 else if ( strcmp(attr_name, "printer-make-and-model") == 0 &&
42 val_tag == IPP_TAG_TEXT ) {
43 - snprintf(t_printer->make_model,sizeof(t_printer->make_model),ippGetString(attr, 0, NULL) );
44 + snprintf(t_printer->make_model,sizeof(t_printer->make_model),"%s", ippGetString(attr, 0, NULL) );
46 else if ( strcmp(attr_name, "printer-state") == 0 &&
47 val_tag == IPP_TAG_ENUM ) {