t1lib-5.1.2-format-security.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. fixes FTBFS with -Werror=format-security by using relevant "%s" format when
  2. passing a variable string to a printf()
  3. Origin: https://bugs.debian.org/646470
  4. --- a/lib/type1/objects.c
  5. +++ b/lib/type1/objects.c
  6. @@ -957,7 +957,7 @@
  7. sprintf(typemsg, "Wrong object type in %s; expected %s, found %s.\n",
  8. name, TypeFmt(expect), TypeFmt(obj->type));
  9. - IfTrace0(TRUE,typemsg);
  10. + IfTrace1(TRUE, "%s", typemsg);
  11. ObjectPostMortem(obj);
  12. --- a/lib/t1lib/t1subset.c
  13. +++ b/lib/t1lib/t1subset.c
  14. @@ -759,7 +759,7 @@
  15. tr_len);
  16. T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
  17. T1LOG_DEBUG);
  18. - l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
  19. + l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
  20. }
  21. /* compute size of output file */
  22. --- a/lib/type1/objects.h
  23. +++ b/lib/type1/objects.h
  24. @@ -214,7 +214,7 @@
  25. /*SHARED*/
  26. /* NDW: personally, I want to see status and error messages! */
  27. #define IfTrace0(condition,model) \
  28. - {if (condition) printf(model);}
  29. + {if (condition) fputs(model,stdout);}
  30. #define IfTrace1(condition,model,arg0) \
  31. {if (condition) printf(model,arg0);}
  32. #define IfTrace2(condition,model,arg0,arg1) \