From fe9a7248f3a2459758c05909bb432ccc9fa1585e Mon Sep 17 00:00:00 2001 From: Steve Singer Date: Thu, 28 Oct 2010 16:35:33 -0400 Subject: [PATCH] Bug 161: Allow slonik to properly deal with split DDL in execute script where the second line is shorter than the previous line. Make sure the buffer can hold a terminating NULL and ensure that we memcpy it --- src/slonik/slonik.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/slonik/slonik.c b/src/slonik/slonik.c index a1e67b2..5f5da9c 100644 --- a/src/slonik/slonik.c +++ b/src/slonik/slonik.c @@ -1779,10 +1779,10 @@ load_sql_script(SlonikStmt * stmt, SlonikAdmInfo * adminfo, char *fname,...) int rc; char fnamebuf[1024]; char buf[4096]; - char rex1[256]; - char rex2[256]; - char rex3[256]; - char rex4[256]; + char rex1[257]; + char rex2[257]; + char rex3[257]; + char rex4[257]; FILE *stmtp; @@ -4443,7 +4443,7 @@ replace_token(char *resout, char *lines, const char *token, const char *replacem } result_set[o] = '\0'; - memcpy(resout, result_set, o); + memcpy(resout, result_set, o+1); } -- 1.7.0.4