From 023266aac8324a2611361d6b927ac9ef878ef311 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 3 Apr 2008 16:00:14 +0000 Subject: [PATCH] * dcrt0.cc (insert_file): Fix potential buffer overflow. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/dcrt0.cc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3d788d0be..05ca04660 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2008-04-03 Corinna Vinschen + + * dcrt0.cc (insert_file): Fix potential buffer overflow. + 2008-04-03 Corinna Vinschen * path.cc (mount_info::from_fstab): Get module path name of the Cygwin diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index cd2ac1eae..5464cce57 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -165,7 +165,7 @@ insert_file (char *name, char *&cmd) tmp_pathbuf tp; PWCHAR wname = tp.w_get (); - sys_mbstowcs (wname, NT_MAX_PATH + 1, name + 1); + sys_mbstowcs (wname, NT_MAX_PATH, name + 1); f = CreateFileW (wname, GENERIC_READ, /* open for reading */ FILE_SHARE_READ, /* share for reading */