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

From Tom Lane
Subject Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163
Date
Msg-id 1637353.1704656849@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163  (Zu-Ming Jiang <zuming.jiang@inf.ethz.ch>)
Responses Re: BUG #18276: Heap-buffer-overflow triggered in src/backend/utils/adt/datum.c:163  (Zu-Ming Jiang <zuming.jiang@inf.ethz.ch>)
List pgsql-bugs
Zu-Ming Jiang <zuming.jiang@inf.ethz.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



pgsql-bugs by date:

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