summaryrefslogtreecommitdiffstats
path: root/misc.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-18 00:55:59 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-18 00:55:59 +0000
commitddad0a8c23560ba39b786144d8b74be8b8ffd64f (patch)
treeed2585babe7742c081ca13e721150a755c245f32 /misc.c
parent5acd2baf6d350515258a325d3c43ac91a4d89748 (diff)
downloadopenvpn-ddad0a8c23560ba39b786144d8b74be8b8ffd64f.tar.gz
openvpn-ddad0a8c23560ba39b786144d8b74be8b8ffd64f.tar.xz
openvpn-ddad0a8c23560ba39b786144d8b74be8b8ffd64f.zip
gen_path will no longer silently truncate the generated
filename at 256 bytes. git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3076 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 97e8049..901e8cb 100644
--- a/misc.c
+++ b/misc.c
@@ -1129,7 +1129,8 @@ gen_path (const char *directory, const char *filename, struct gc_arena *gc)
#endif
)
{
- struct buffer out = alloc_buf_gc (256, gc);
+ const size_t outsize = strlen(safe_filename) + (directory ? strlen (directory) : 0) + 16;
+ struct buffer out = alloc_buf_gc (outsize, gc);
char dirsep[2];
dirsep[0] = OS_SPECIFIC_DIRSEP;