Commits
Frank Schima authored 4ad5ecc1540
1 + | From 6382711e9b0060bbd0408df512e48b2ce9cdb3be Mon Sep 17 00:00:00 2001 |
2 + | From: William Hubbs <w.d.hubbs@gmail.com> |
3 + | Date: Tue, 22 Jun 2010 14:16:45 -0500 |
4 + | Subject: [PATCH] fix possible buffer overflow in get_path |
5 + | |
6 + | If a pathname is longer than CFG_MAX_FILENAME, there was a possible |
7 + | buffer overflow when copying the path name. |
8 + | --- |
9 + | src/dotconf.c | 2 +- |
10 + | 1 files changed, 1 insertions(+), 1 deletions(-) |
11 + | |
12 + | diff --git src/dotconf.c src/dotconf.c |
13 + | index af553b3..7ba2001 100644 |
14 + | --- src/dotconf.c |
15 + | +++ src/dotconf.c |
16 + | |
17 + | } else { |
18 + | len = tmp - name + 1; |
19 + | if (len > CFG_MAX_FILENAME) |
20 + | - len -= 1; |
21 + | + len = CFG_MAX_FILENAME; |
22 + | } |
23 + | snprintf(buf, len, "%s", name); |
24 + | return buf; |
25 + | -- |
26 + | 1.7.3.3 |
27 + | |