File: fix-buffer-overflow.patch

package info (click to toggle)
airstrike 0.99%2B1.0pre6a-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,396 kB
  • sloc: ansic: 6,778; asm: 1,773; makefile: 179; sh: 35; pascal: 15
file content (21 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
Date: Sun, 30 Mar 2014 21:01:08 +0200
Subject: fix-buffer-overflow

---
 src/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/config.c b/src/config.c
index 6379b26..95cbd5f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -21,7 +21,7 @@ int config_setup()
     }
   if (getenv("HOME"))
     {
-      sprintf(cbuf,"%s/%s",getenv("HOME"),USER_CONFIG_FILE);      
+      snprintf(cbuf,sizeof(cbuf),"%s/%s",getenv("HOME"),USER_CONFIG_FILE);
       cfile = fopen(cbuf,"r");
       if (cfile)
 	{