Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zu-Ming Jiang <zuming(dot)jiang(at)inf(dot)ethz(dot)ch>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163
Date: 2024-01-07 19:47:29
Message-ID: 1637353.1704656849@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Zu-Ming Jiang <zuming(dot)jiang(at)inf(dot)ethz(dot)ch> writes:
> But I am bit wondering whether it is a bug. I think PostgreSQL should
> not directly crash because of a incorrect datatype. Maybe PostgreSQL can
> return an error?

It's not reasonable to expect the system to figure out the behavior
of C functions (see: halting problem). In the end this is why
creating base types is a superuser-only operation: it's possible
to crash the server with a wrong definition. I don't see any prospect
of making that meaningfully safer.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Zu-Ming Jiang 2024-01-07 20:15:32 Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163
Previous Message Tom Lane 2024-01-07 19:42:39 Re: BUG #18273: Incorrect memory access occurs when gist__int index is building on data containing 2^31-1