1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-28 05:21:27 +03:00

1148 Commits

Author SHA1 Message Date
Tom Lane
b99751a199 Fix xslt_process() to ensure that it inserts a NULL terminator after the
last pair of parameter name/value strings, even when there are MAXPARAMS
of them.  Aboriginal bug in contrib/xml2, noted while studying bug #4912
(though I'm not sure whether there's something else involved in that
report).

This might be thought a security issue, since it's a potential backend
crash; but considering that untrustworthy users shouldn't be allowed
to get their hands on xslt_process() anyway, it's probably not worth
getting excited about.
2009-07-10 00:32:23 +00:00
Magnus Hagander
e0ec95d7bf Remove beer-ware license from crypt-md5.c, per
approval from Poul-Henning Kamp.

This makes the file the same standard 2-clause BSD as the
rest of PostgreSQL.
2009-04-15 18:58:30 +00:00
Tom Lane
5525d26684 Defend against non-ASCII letters in fuzzystrmatch code. The functions
still don't behave very sanely for multibyte encodings, but at least
they won't be indexing off the ends of static arrays.
2009-04-07 15:54:16 +00:00
Tom Lane
af4ebb272e Fix contrib/pgstattuple and contrib/pageinspect to prevent attempts to read
temporary tables of other sessions; that is unsafe because of the way our
buffer management works.  Per report from Stuart Bishop.
This is redundant with the bufmgr.c checks in HEAD, but not at all redundant
in the back branches.
2009-03-31 22:56:05 +00:00
Tom Lane
8f332cf79e Fix old thinko in pgp.h: the idea is to declare some named enum types,
not global variables of anonymous enum types.  This didn't actually hurt
much because most linkers will just merge the duplicated definitions ...
but some will complain.  Per bug #4731 from Ceriel Jacobs.

Backpatch to 8.1 --- the declarations don't exist before that.
2009-03-25 15:03:30 +00:00
Teodor Sigaev
8bdcdd2274 Fix uninitialized variables in get_covers 2009-01-16 12:08:13 +00:00
Teodor Sigaev
c3bf525248 Sync output of tsearch2 regression test 2009-01-16 12:06:35 +00:00
Teodor Sigaev
ff25ee0c7a Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
2009-01-15 18:05:04 +00:00
Teodor Sigaev
a82832465b Fix URL generation in headline. Only tag lexeme will be replaced by space.
Per http://archives.postgresql.org/pgsql-bugs/2008-12/msg00013.php
2009-01-15 18:04:42 +00:00
Teodor Sigaev
feb4596697 Fix small bug in headline generation.
Patch from Sushant Sinha <sushant354@gmail.com>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
2008-10-17 17:41:16 +00:00
Tom Lane
773f5cc8cb Fix contrib/xml2 makefile to not override CFLAGS. 2008-05-08 17:11:41 +00:00
Tom Lane
52441adb15 Fix several datatype input functions that were allowing unused bytes in their
results to contain uninitialized, unpredictable values.  While this was okay
as far as the datatypes themselves were concerned, it's a problem for the
parser because occurrences of the "same" literal might not be recognized as
equal by datumIsEqual (and hence not by equal()).  It seems sufficient to fix
this in the input functions since the only critical use of equal() is in the
parser's comparisons of ORDER BY and DISTINCT expressions.
Per a trouble report from Marc Cousin.

Patch all the way back.  Interestingly, array_in did not have the bug before
8.2, which may explain why the issue went unnoticed for so long.
2008-04-11 22:53:16 +00:00
Tom Lane
207f469912 Fix core dump in contrib/xml2's xpath_table() when the input query returns
a NULL value.  Per bug #4058.
2008-03-26 01:19:23 +00:00
Tom Lane
148bd52da4 The original patch to disallow non-passworded connections to non-superusers
failed to cover all the ways in which a connection can be initiated in dblink.
Plug the remaining holes.  Also, disallow transient connections in functions
for which that feature makes no sense (because they are only sensible as
part of a sequence of operations on the same connection).  Joe Conway

Security: CVE-2007-6601
2008-01-03 21:28:30 +00:00
Teodor Sigaev
9275f2d34c Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <bruce@momjian.us>
2007-11-16 17:09:15 +00:00
Joe Conway
0b33e2066f Have crosstab variants treat NULL rowid as a category in its own right,
per suggestion from Tom Lane. This fixes crash-bug reported by Stefan
Schwarzer.
2007-11-10 05:01:50 +00:00
Tom Lane
d218e2332b Defend against openssl libraries that fail on keys longer than 128 bits;
which is the case at least on some Solaris versions.  Marko Kreen
2007-09-29 15:50:07 +00:00
Teodor Sigaev
bc16ca2746 Fix crash of to_tsvector() function on huge input: compareWORD()
function didn't return correct result for word position greate than
limit.

Per report from Stuart Bishop <stuart@stuartbishop.net>
2007-09-26 10:30:53 +00:00
Teodor Sigaev
8605cfaa3d Fix header's size of structs defines in ispell. 2007-09-11 13:06:28 +00:00
Tom Lane
d68b66984c Fix combo_decrypt() to throw an error for zero-length input when using a
padded encryption scheme.  Formerly it would try to access res[(unsigned) -1],
which resulted in core dumps on 64-bit machines, and was certainly trouble
waiting to happen on 32-bit machines (though in at least the known case
it was harmless because that byte would be overwritten after return).
Per report from Ken Colson; fix by Marko Kreen.
2007-08-23 16:16:05 +00:00
Joe Conway
7ff65db8b0 Restrict non-superusers to password authenticated connections
to prevent possible escalation of privilege. Provide new SECURITY
DEFINER functions with old behavior, but initially REVOKE ALL
from public for these functions. Per list discussion and design
proposed by Tom Lane.
2007-07-09 01:32:44 +00:00
Teodor Sigaev
368cc140d9 Fix caching of unsuccessful initialization of parser or configuration.
Per report from Listmail <lists@peufeu.com>
2007-04-02 11:42:44 +00:00
Teodor Sigaev
3e5a4a9a08 Fix backend crash in parsing incorrect tsquery.
Per report from Jon Rosebaugh <jon@inklesspen.com>
2007-02-12 14:17:40 +00:00
Tatsuo Ishii
e6be37ffe2 Back port patch.
Call srandom() instead of srand().
pgbench calls random() later, so it should have called srandom().
On most platforms except Windows srandom() is actually identical
to srand(), so the bug only bites Windows users.
per bug report from Akio Ishida.
2007-01-10 01:44:30 +00:00
Teodor Sigaev
3dd05aba09 Fix convertion for 'PFX flag N num' 2006-12-21 17:35:55 +00:00
Teodor Sigaev
60a25e6f6f Add description of tsvector type layout 2006-08-29 13:57:11 +00:00
Teodor Sigaev
3538b740f3 Remove pos comparison in silly_cmp_tsvector(): it is not a semantically significant 2006-08-29 13:40:11 +00:00
Teodor Sigaev
a3cb2221f3 Fix incorrect length of lexemes in silly_cmp_tsvector() 2006-08-29 13:32:21 +00:00
Teodor Sigaev
747b82aa6a Fix regression tests: after changing comparing function
order is changed.
2006-08-25 07:39:22 +00:00
Teodor Sigaev
2ec2b2caf0 Fix compare bug for tsvector: problem was in aligment. Per Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> and Phil Frost <indigo@bitglue.com> 2006-08-24 17:38:00 +00:00
Teodor Sigaev
73761f3659 Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com> 2006-08-08 15:45:24 +00:00
Teodor Sigaev
e33ab5b6d5 fix bug about modifying value in shared buffer,
what was a reason to corrupt index.
Thank to Mario Weilguni <mweilguni@sime.com> to
discover a bug.
2006-08-07 17:40:20 +00:00
Neil Conway
381ebcd21f Fix references to the Options section in the pgcrypto documentation.
Patch from Michael Fuhr.
2006-08-05 00:29:14 +00:00
Teodor Sigaev
f446ede326 Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.
2006-07-11 16:02:50 +00:00
Bruce Momjian
fe204535a7 Backpatch dbmirror fix for escape handling.
> Upstream confirmed my reply in the last mail in [1]: the complete
> escaping logic in DBMirror.pl is seriously screwew.
>
> [1] http://archives.postgresql.org/pgsql-bugs/2006-06/msg00065.php

I finally found some time to debug this, and I think I found a better
patch than the one you proposed. Mine is still hackish and is still a
workaround around a proper quoting solution, but at least it repairs
the parsing without introducing the \' quoting again.

I consider this a band-aid patch to fix the recent security update.
PostgreSQL gurus, would you consider applying this until a better
solution is found for DBMirror.pl?

Olivier, can you please confirm that the patch works for you, too?

Backpatched to 8.0.X.

Martin Pitt
2006-07-06 01:57:34 +00:00
Joe Conway
e582d2ee1a - During dblink_open, if transaction state was IDLE, force cursor count to
initially be 0. This is needed as a previous ABORT might have wiped out
  an automatically opened transaction without maintaining the cursor count.
- Fix regression test expected file for the correct ERROR message, which
  we now get given the above bug fix.
2006-06-21 16:43:46 +00:00
Andrew Dunstan
b243d39456 backport workaround for OpenBSD compiler bug 2006-06-17 14:49:02 +00:00
Bruce Momjian
f671bee9d0 Re-defines SHA2 symbols so that they would not conflict with certain
versions of OpenSSL.  If your OpenSSL does not contain SHA2, then there
should be no conflict.  But ofcourse, if someone upgrades OpenSSL,
server starts crashing.

Backpatched to 8.1.X.

Marko Kreen
2006-05-30 12:56:56 +00:00
Tom Lane
dd2a4ce6ac Fix errors in fortuna PRNG reseeding logic that could cause a predictable
session key to be selected by pgp_sym_encrypt() in some cases.  This only
affects non-OpenSSL-using builds.  Marko Kreen
2006-05-21 20:22:23 +00:00
Bruce Momjian
3a3622c5f0 Back out \' change for tsearch2, broke regression tests. 2006-05-19 04:41:06 +00:00
Bruce Momjian
9a27f72b37 Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X. 2006-05-19 02:39:04 +00:00
Teodor Sigaev
06e4478877 Detoast query in g_intbig_consistent and copy query in g_int_consistent.
Minor cleanups.
2006-04-03 09:35:35 +00:00
Tom Lane
effecebad1 Fix order of linking of libxslt and libxml2, per Dave Page. 2006-03-10 15:39:53 +00:00
Tom Lane
05d2a7256e Fix vacuumlo to avoid unnecessary use of backslash in search pattern.
Per Michael Fuhr.
2006-02-23 22:34:07 +00:00
Neil Conway
3bd549ba0a Patch from Marko Kreen:
pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Thanks to Daniel Blaisdell for reporting it.
2006-02-18 20:48:53 +00:00
Tom Lane
4977c2b31b Replace bitwise looping with bytewise looping in hemdistsign and
sizebitvec of tsearch2, as well as identical code in several other
contrib modules.  This provided about a 20X speedup in building a
large tsearch2 index ... didn't try to measure its effects for other
operations.  Thanks to Stephan Vollmer for providing a test case.
2006-01-20 22:46:40 +00:00
Tom Lane
f5b50af291 There is a signedness bug in Openwall gen_salt code that pgcrypto uses.
This makes the salt space for md5 and xdes algorithms a lot smaller than
it should be.

Marko Kreen
2006-01-03 23:46:38 +00:00
Joe Conway
17903a7375 When the remote query result has a different number of columns
than the local query specifies (e.g. in the FROM clause),
throw an ERROR (instead of crashing). Fix for bug #2129 reported
by Akio Iwaasa.
2006-01-03 23:46:32 +00:00
Teodor Sigaev
dacf7e774d Fix word's length in pg_regexec call 2005-12-21 13:07:38 +00:00
Tom Lane
31a21e3df0 Remove incorrect increment of lineno, per David Fetter.
Sync HEAD and 8.1 branches of pgbench.
2005-12-10 01:09:14 +00:00