Lists: | pgsql-bugs |
---|
From: | "Branden R(dot) Williams" <brw(at)brw(dot)net> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Bug Report |
Date: | 2003-10-07 21:12:57 |
Message-ID: | Pine.LNX.4.58.0310071600510.26390@altair.kickinit.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================
Your name : Branden R. Williams
Your email address : brw(at)brw(dot)net
System Configuration
---------------------
Architecture (example: Intel Pentium) : Intel Pentium
Operating System (example: Linux 2.0.26 ELF) : Linux 2.4.18 ELF
PostgreSQL version (example: PostgreSQL-7.3.4): PostgreSQL-7.3.4
Compiler used (example: gcc 2.95.2) : Your RPM, RH 8.
Please enter a FULL description of your problem:
------------------------------------------------
When using the replace() function, it appears that some of the output is
filtered through a printf variant. If you have legitimate db characters
that are also printf flags, it causes big problems.
Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
Place this data inside one field in a db...
/estore/purchase_licenses.asp?numberoflicenses='UNION'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='UNION'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='%22&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='%22&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=9%2c+9%2c+9&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=9%2c+9%2c+9&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='bad_bad_value&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='bad_bad_value&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=bad_bad_value'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=bad_bad_value'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='+OR+'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='+OR+'&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='WHERE&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='WHERE&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=%3B&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses=%3B&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='OR&ID=1& =
/estore/purchase_licenses.asp?numberoflicenses='OR&ID=1& =
Now pretend that you want to filter out various characters, including the
% because %2c is something that printf uses. In my app, I use printf to
parse data that comes from the database, so I need to fix this.
Doing a nested replace, select the field out using the following
commands...
replace(replace(replace(reportresults.data, chr(92), '\'), chr(37),
'%'), chr(9), '') as data
Look at the results and you will notice the select does not look like it
does if you do not filter at all (or have the replaced characters in there
on some lines).
If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
You will probably have to filter out any % so that printf does not try to
interpret it.
From: | Joe Conway <mail(at)joeconway(dot)com> |
---|---|
To: | "Branden R(dot) Williams" <brw(at)brw(dot)net> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: Bug Report |
Date: | 2003-10-08 21:58:13 |
Message-ID: | 3F848875.3040908@joeconway.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
Branden R. Williams wrote:
> ============================================================================
> POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
> Your name : Branden R. Williams
> Your email address : brw(at)brw(dot)net
> System Configuration
> ---------------------
> Architecture (example: Intel Pentium) : Intel Pentium
> Operating System (example: Linux 2.0.26 ELF) : Linux 2.4.18 ELF
> PostgreSQL version (example: PostgreSQL-7.3.4): PostgreSQL-7.3.4
> Compiler used (example: gcc 2.95.2) : Your RPM, RH 8.
> Please enter a FULL description of your problem:
> ------------------------------------------------
> When using the replace() function, it appears that some of the output is
> filtered through a printf variant. If you have legitimate db characters
> that are also printf flags, it causes big problems.
This was fixed for 7.3.4 (or so I thought); see:
http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/adt/varlena.c.diff?r1=1.92&r2=1.92.2.1
Are you sure you don't have something earlier? Was does
select version();
show?
Joe
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | "Branden R(dot) Williams" <brw(at)brw(dot)net> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: Bug Report |
Date: | 2003-10-08 22:44:38 |
Message-ID: | 5593.1065653078@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
"Branden R. Williams" <brw(at)brw(dot)net> writes:
> When using the replace() function, it appears that some of the output is
> filtered through a printf variant.
This was fixed as of 7.3.3.
regards, tom lane
From: | "Branden R(dot) Williams" <brw(at)brw(dot)net> |
---|---|
To: | Joe Conway <mail(at)joeconway(dot)com> |
Cc: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: Bug Report |
Date: | 2003-10-09 00:51:11 |
Message-ID: | Pine.LNX.4.58.0310081949470.26390@altair.kickinit.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-bugs |
Nuts, my sincere apologies on this one. This is the one server in our
entire farm that is not 7.3.4. I'm upgrading right now.
Sorry for the inconvenience!
On Wed, 8 Oct 2003, Joe Conway wrote:
> Branden R. Williams wrote:
> > ============================================================================
> > POSTGRESQL BUG REPORT TEMPLATE
> > ============================================================================
> > Your name : Branden R. Williams
> > Your email address : brw(at)brw(dot)net
> > System Configuration
> > ---------------------
> > Architecture (example: Intel Pentium) : Intel Pentium
> > Operating System (example: Linux 2.0.26 ELF) : Linux 2.4.18 ELF
> > PostgreSQL version (example: PostgreSQL-7.3.4): PostgreSQL-7.3.4
> > Compiler used (example: gcc 2.95.2) : Your RPM, RH 8.
> > Please enter a FULL description of your problem:
> > ------------------------------------------------
> > When using the replace() function, it appears that some of the output is
> > filtered through a printf variant. If you have legitimate db characters
> > that are also printf flags, it causes big problems.
>
> This was fixed for 7.3.4 (or so I thought); see:
> http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/adt/varlena.c.diff?r1=1.92&r2=1.92.2.1
> Are you sure you don't have something earlier? Was does
> select version();
> show?
>
> Joe
>
Fair Winds and Following Seas,
Branden R. Williams, CISSP
<brw(at)brw(dot)net>
http://www.brw.net/
--
Public Key ID: 0x442E9483 | PGP Keyserver: pgp.mit.edu
Public Key Fingerprint: 6B44 B798 934F 043D C34D 219F D628 FC0E 442E 9483