From 294b1c9f6eda839d22c1509199887e9650b377fe Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Oct 2022 11:30:02 -0600 Subject: [PATCH] Use snprintf instead of sprintf --- src/OT/Layout/GSUB/Ligature.hh | 2 +- src/OT/Layout/GSUB/Sequence.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OT/Layout/GSUB/Ligature.hh b/src/OT/Layout/GSUB/Ligature.hh index f373d921b..6caa80e05 100644 --- a/src/OT/Layout/GSUB/Ligature.hh +++ b/src/OT/Layout/GSUB/Ligature.hh @@ -118,7 +118,7 @@ struct Ligature match_positions[i] += delta; if (i) *p++ = ','; - sprintf (p, "%u", match_positions[i]); + snprintf (p, sizeof(buf), "%u", match_positions[i]); p += strlen(p); } diff --git a/src/OT/Layout/GSUB/Sequence.hh b/src/OT/Layout/GSUB/Sequence.hh index 3d84a5e6e..abf1c643f 100644 --- a/src/OT/Layout/GSUB/Sequence.hh +++ b/src/OT/Layout/GSUB/Sequence.hh @@ -117,7 +117,7 @@ struct Sequence { if (buf < p) *p++ = ','; - sprintf (p, "%u", i); + snprintf (p, sizeof(buf), "%u", i); p += strlen(p); }