Re: fix for palloc() of user-supplied length
От | Serguei Mokhov |
---|---|
Тема | Re: fix for palloc() of user-supplied length |
Дата | |
Msg-id | 1031179863.3d768e57419cd@mailhost.cs.concordia.ca обсуждение исходный текст |
Ответ на | Re: fix for palloc() of user-supplied length (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-patches |
Quoting Tom Lane <tgl@sss.pgh.pa.us>: > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > I wish there was an easier way to fix this, but it seems you have done > > the research and this is what is required. > > This is awfully messy. There's got to be a cleaner way of divvying up > this code... Just to clarify a bit on my solution in case my English didn't get through properly the first time... I simply provided two versions of pq_getstr - pq_getstr() with the same behaviour as before (read until input isn't over by \0) and pq_getstr_bounded() that reads up to a certain limit or till \0. Functions needed split, IMNSHO, because grep of the source gave more invocations of pq_getstr, which I was afaraid to break, so that's why two functions. I can justify the rest as well, if you wish. If you are positive, be the change in one function only it would not break anything, then the cleaner solution is just to change that one function - pg_gestring() invoked directly by pg_getstr(). -s -- Serguei A. Mokhov, <mailto: mokhov @ cs.concordia.ca> Computer Science, Concordia University ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/
В списке pgsql-patches по дате отправления: