Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
98 magnus 1
From: Nathaniel <me@nathanielbennett.com>
2
Date: Tue, 8 Jun 2021 06:43:29 -0400
3
Subject: Sanity check for sprintf
4
Origin: https://github.com/shevek/libspf2/commit/28faf4624a6a371b11afdb9820078d3b0ee3803d
5
 
6
---
7
 src/libspf2/spf_expand.c | 5 +----
8
 1 file changed, 1 insertion(+), 4 deletions(-)
9
 
10
diff --git a/src/libspf2/spf_expand.c b/src/libspf2/spf_expand.c
11
index e7f5a26f3e1b..25689da11e84 100644
12
--- a/src/libspf2/spf_expand.c
13
+++ b/src/libspf2/spf_expand.c
14
@@ -398,10 +398,7 @@ top:
15
                                                break;
16
 
17
                                        default:
18
-                                               /* No point doing snprintf with a const '4'
19
-                                                * because we know we're going to get 4
20
-                                                * characters anyway. */
21
-                                               sprintf( p_write, "%%%02x", *p_read );
22
+                                               snprintf( p_write, 4, "%%%02x", (unsigned char) *p_read );
23
                                                p_write += 3;
24
                                                p_read++;
25
                                                break;
26
-- 
27
2.20.1
28