pgsql-server/src/backend/utils/adt oracle_compat.c

Started by Bruce Momjianalmost 24 years ago3 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian@postgresql.org 02/08/22 00:54:20

Modified files:
src/backend/utils/adt: oracle_compat.c

Log message:
repeat() fix:

Neil Conway <neilc@samurai.com> writes:

+   /* Check for integer overflow */
+   if (tlen / slen != count)
+           elog(ERROR, "Requested buffer is too large.");

What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

Neil Conway

#2Neil Conway
neilc@samurai.com
In reply to: Bruce Momjian (#1)
Re: pgsql-server/src/backend/utils/adt oracle_compat.c

momjian@postgresql.org (Bruce Momjian - CVS) writes:

Modified files:
src/backend/utils/adt: oracle_compat.c

Log message:
repeat() fix:

Neil Conway <neilc@samurai.com> writes:

+   /* Check for integer overflow */
+   if (tlen / slen != count)
+           elog(ERROR, "Requested buffer is too large.");

What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

This is the wrong version of the patch -- please apply the updated
patch I sent to -hackers (which is the same one I sent to you via
private mal).

Also, this should be applied to REL7_2_STABLE as well, IMHO.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

#3Bruce Momjian
bruce@momjian.us
In reply to: Neil Conway (#2)
Re: pgsql-server/src/backend/utils/adt oracle_compat.c

OK, updated patch attached.

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

Neil Conway wrote:

momjian@postgresql.org (Bruce Momjian - CVS) writes:

Modified files:
src/backend/utils/adt: oracle_compat.c

Log message:
repeat() fix:

Neil Conway <neilc@samurai.com> writes:

+   /* Check for integer overflow */
+   if (tlen / slen != count)
+           elog(ERROR, "Requested buffer is too large.");

What about slen == 0?

Good point -- that wouldn't cause incorrect results or a security
problem, but it would reject input that we should really accept.

Revised patch is attached.

This is the wrong version of the patch -- please apply the updated
patch I sent to -hackers (which is the same one I sent to you via
private mal).

Also, this should be applied to REL7_2_STABLE as well, IMHO.

Cheers,

Neil

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC

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

http://www.postgresql.org/users-lounge/docs/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

Attachments:

/bjm/9text/plainDownload+10-0