*** pgsql/contrib/xml2/xslt_proc.c 2007/07/15 23:30:19 1.9 --- pgsql/contrib/xml2/xslt_proc.c 2009/07/10 00:32:12 1.9.2.1 *************** static void parse_params(const char **pa *** 35,41 **** Datum xslt_process(PG_FUNCTION_ARGS); ! #define MAXPARAMS 20 PG_FUNCTION_INFO_V1(xslt_process); --- 35,42 ---- Datum xslt_process(PG_FUNCTION_ARGS); ! #define MAXPARAMS 20 /* must be even, see parse_params() */ ! PG_FUNCTION_INFO_V1(xslt_process); *************** xslt_process(PG_FUNCTION_ARGS) *** 135,146 **** } ! void parse_params(const char **params, text *paramstr) { char *pos; char *pstr; - int i; char *nvsep = "="; char *itsep = ","; --- 136,146 ---- } ! static void parse_params(const char **params, text *paramstr) { char *pos; char *pstr; int i; char *nvsep = "="; char *itsep = ","; *************** parse_params(const char **params, text * *** 160,170 **** } else { ! params[i] = NULL; break; } /* Value */ i++; params[i] = pos; pos = strstr(pos, itsep); if (pos != NULL) --- 160,172 ---- } else { ! /* No equal sign, so ignore this "parameter" */ ! /* We'll reset params[i] to NULL below the loop */ break; } /* Value */ i++; + /* since MAXPARAMS is even, we still have i < MAXPARAMS */ params[i] = pos; pos = strstr(pos, itsep); if (pos != NULL) *************** parse_params(const char **params, text * *** 173,181 **** pos++; } else break; ! } ! if (i < MAXPARAMS) ! params[i + 1] = NULL; } --- 175,185 ---- pos++; } else + { + i++; break; ! } } ! ! params[i] = NULL; }