TM formating patch

Started by Pavel Stehuleover 19 years ago7 messagespatches
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hello,

I am sorry for preview chotic mails. My web email client is stupid (I am
too).

This patch correct bug, when localized day or month names was incorectly
trnasformed to lower or upper string.

Regards
Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/

Attachments:

TMformat.difftext/x-patch; name=TMformat.diffDownload+214-42
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: TM formating patch

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was incorectly
trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: TM formating patch

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was incorectly
trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

I correct it, and test it for czech latin2 and utf8 case.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

Attachments:

TM_formatting.difftext/x-patch; name=TM_formatting.diffDownload+219-57
#4Bruce Momjian
bruce@momjian.us
In reply to: Pavel Stehule (#3)
Re: TM formating patch

Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

Pavel Stehule wrote:

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was incorectly
trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

I correct it, and test it for czech latin2 and utf8 case.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#5Bruce Momjian
bruce@momjian.us
In reply to: Pavel Stehule (#3)
Re: TM formating patch

Patch applied. Thanks.

I have not backpatched it to 8.2.X because I am unclear of the risk
involved. Suggestions?

---------------------------------------------------------------------------

Pavel Stehule wrote:

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was incorectly
trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

I correct it, and test it for czech latin2 and utf8 case.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#6Pavel Stehule
pavel.stehule@gmail.com
In reply to: Bruce Momjian (#5)
Re: TM formating patch

Patch applied. Thanks.

I have not backpatched it to 8.2.X because I am unclear of the risk
involved. Suggestions?

It's bug in 8.2. I don't know about any risks for 8.2

Pavel

---------------------------------------------------------------------------

Pavel Stehule wrote:

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was

incorectly

trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

I correct it, and test it for czech latin2 and utf8 case.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

#7Bruce Momjian
bruce@momjian.us
In reply to: Pavel Stehule (#6)
Re: TM formating patch

Pavel Stehule wrote:

Patch applied. Thanks.

I have not backpatched it to 8.2.X because I am unclear of the risk
involved. Suggestions?

It's bug in 8.2. I don't know about any risks for 8.2

OK, I have backpatched it to 8.2.X.

---------------------------------------------------------------------------

Pavel

---------------------------------------------------------------------------

Pavel Stehule wrote:

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

This patch correct bug, when localized day or month names was

incorectly

trnasformed to lower or upper string.

I really dislike the API you've chosen for upper_str/lower_str ---
overwriting the input on the assumption that it's long enough is a
buffer overrun bug waiting to happen, because (at least in utf8)
changing case doesn't preserve the byte length of the string.
Please make them return a freshly palloc'd string instead.

regards, tom lane

I correct it, and test it for czech latin2 and utf8 case.

Regards
Pavel Stehule

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

[ Attachment, skipping... ]

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +