Re: pgsql 8.0 beta1 patch for token and timezone
От | Bruce Momjian |
---|---|
Тема | Re: pgsql 8.0 beta1 patch for token and timezone |
Дата | |
Msg-id | 200410071729.i97HTB516272@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: pgsql 8.0 beta1 patch for token and timezone (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-bugs |
OK, fixed. --------------------------------------------------------------------------- Tom Lane wrote: > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > + /* > > + * Escape any single quotes or backslashes in locale > > + */ > > + static void > > + escape_locale(char **locale) > > + { > > + int len = strlen(*locale), > > + i, j; > > + char *loc_temp = xmalloc(len * 2); > > + > > + for (i = 0, j = 0; i < len; i++) > > + { > > + if ((*locale)[i] == '\'' || (*locale)[i] == '\\') > > + loc_temp[j++] = '\\'; > > + loc_temp[j++] = (*locale)[i]; > > + } > > + *locale = loc_temp; > > + } > > Surely this is quite broken. You need to xmalloc one more byte and > add a '\0'. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faqs/FAQ.html > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
В списке pgsql-bugs по дате отправления: