Changeset: 3e9936d89601 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3e9936d89601 Modified Files: MonetDB5/src/optimizer/opt_mitosis.mx Branch: default Log Message:
defensive programming to avoid server crashes (segfaults) Apparently, checking only for module name "sql", function name "assert", and TYPE_str of argument 2 does not necessarily guarantee that (a) there are at least 3 arguments (incl. return value), and (b) the string pointer of the second argument's value is not NULL. Hence, we add some extra sanity checks to avoid crashes (segfaults) that occur with (at least) 17 SQL tests. diffs (13 lines): diff -r d49ee783f84d -r 3e9936d89601 MonetDB5/src/optimizer/opt_mitosis.mx --- a/MonetDB5/src/optimizer/opt_mitosis.mx Mon Jun 14 15:45:39 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_mitosis.mx Tue Jun 15 06:55:07 2010 +0200 @@ -73,7 +73,8 @@ for (i=1; i< mb->stop; i++){ p = getInstrPtr(mb,i); if ( getModuleId(p) == sqlRef && getFunctionId(p) == assertRef && - getArgType(mb,p,2) == TYPE_str && + p->argc > 2 && getArgType(mb,p,2) == TYPE_str && + getVarConstant(mb, getArg(p,2)).val.sval != NULL && strstr(getVarConstant(mb, getArg(p,2)).val.sval, "PRIMARY KEY constraint") ) return 0; } _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list