Changeset: 853a8071e693 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=853a8071e693
Modified Files:
monetdb5/mal/mal_parser.c
Branch: Jul2015
Log Message:
Don't use a ridiculously large buffer against overflow: just check for it.
diffs (21 lines):
diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c
--- a/monetdb5/mal/mal_parser.c
+++ b/monetdb5/mal/mal_parser.c
@@ -2043,7 +2043,7 @@ parseError(Client cntxt, str msg)
{
Symbol curPrg;
MalBlkPtr curBlk;
- char buf[10 * 1024];
+ char buf[1028];
char *s = buf, *t, *l = lastline(cntxt);
lng i;
@@ -2054,7 +2054,7 @@ parseError(Client cntxt, str msg)
/* accidental %s directives in the lastline can
crash the vfsprintf later => escape them */
- for (t = l; *t && *t != '\n'; t++) {
+ for (t = l; *t && *t != '\n' && s < buf+1024; t++) {
if (*t == '%')
*s++ = '%';
*s++ = *t;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list