0001-telnet-telnetd-Fix-print-format-strings.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. From 7a3095d1e9b7c73f9dca56250f433bcfc7cb660e Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Tue, 27 Jun 2017 10:15:34 -0700
  4. Subject: [PATCH] telnet/telnetd: Fix print format strings
  5. Fixes build with hardening flags
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. ---
  8. Upstream-Status: Pending
  9. telnet/utilities.cc | 6 +++---
  10. telnetd/utility.c | 6 +++---
  11. 2 files changed, 6 insertions(+), 6 deletions(-)
  12. diff --git a/telnet/utilities.cc b/telnet/utilities.cc
  13. index 66839ab..36f0731 100644
  14. --- a/telnet/utilities.cc
  15. +++ b/telnet/utilities.cc
  16. @@ -583,17 +583,17 @@ void printsub(int direction, unsigned char *pointer, int length) {
  17. case ENV_VAR:
  18. if (pointer[1] == TELQUAL_SEND)
  19. goto def_case;
  20. - fprintf(NetTrace, "\" VAR " + noquote);
  21. + fprintf(NetTrace, "%s", "\" VAR " + noquote);
  22. noquote = 2;
  23. break;
  24. case ENV_VALUE:
  25. - fprintf(NetTrace, "\" VALUE " + noquote);
  26. + fprintf(NetTrace, "%s", "\" VALUE " + noquote);
  27. noquote = 2;
  28. break;
  29. case ENV_ESC:
  30. - fprintf(NetTrace, "\" ESC " + noquote);
  31. + fprintf(NetTrace, "%s", "\" ESC " + noquote);
  32. noquote = 2;
  33. break;
  34. diff --git a/telnetd/utility.c b/telnetd/utility.c
  35. index 29b7da1..75314cb 100644
  36. --- a/telnetd/utility.c
  37. +++ b/telnetd/utility.c
  38. @@ -909,17 +909,17 @@ printsub(char direction, unsigned char *pointer, int length)
  39. case ENV_VAR:
  40. if (pointer[1] == TELQUAL_SEND)
  41. goto def_case;
  42. - netoprintf("\" VAR " + noquote);
  43. + netoprintf("%s", "\" VAR " + noquote);
  44. noquote = 2;
  45. break;
  46. case ENV_VALUE:
  47. - netoprintf("\" VALUE " + noquote);
  48. + netoprintf("%s", "\" VALUE " + noquote);
  49. noquote = 2;
  50. break;
  51. case ENV_ESC:
  52. - netoprintf("\" ESC " + noquote);
  53. + netoprintf("%s", "\" ESC " + noquote);
  54. noquote = 2;
  55. break;
  56. --
  57. 2.13.2