public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH setup] Fix an allocation length error
@ 2020-03-19 14:13 Jon Turney
  0 siblings, 0 replies; only message in thread
From: Jon Turney @ 2020-03-19 14:13 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Jon Turney

Allow for the terminating null.
---
 archive.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/archive.cc b/archive.cc
index e4af4f7..1ceb355 100644
--- a/archive.cc
+++ b/archive.cc
@@ -173,7 +173,7 @@ archive::extract_file (archive * source, const std::string& prefixURL,
 	  break;
 	case ARCHIVE_FILE_DIRECTORY:
 	  {
-	    char *path = (char *) alloca (destfilename.size());
+	    char *path = (char *) alloca (destfilename.size() + 1);
 	    strcpy (path, destfilename.c_str());
 	    while (path[0] && path[strlen (path) - 1] == '/')
 	      path[strlen (path) - 1] = 0;
-- 
2.21.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-19 14:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-19 14:13 [PATCH setup] Fix an allocation length error Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).