[postgis-devel] [PostGIS] #1263: [raster] md5(NULL::raster) crashes the process

dustymugs dustymugs at gmail.com
Wed Nov 2 11:34:18 PDT 2011


On 11/02/2011 01:55 AM, Sandro Santilli wrote:
> On Tue, Nov 01, 2011 at 10:49:14PM -0000, PostGIS wrote:
>> #1263: [raster] md5(NULL::raster) crashes the process
>> ----------------------------+-----------------------------------------------
>>   Reporter:  dustymugs       |       Owner:  dustymugs
>>       Type:  defect          |      Status:  new
>>   Priority:  medium          |   Milestone:  PostGIS 2.0.0
>> Component:  postgis raster  |     Version:  trunk
>>   Keywords:                  |
>> ----------------------------+-----------------------------------------------
>>   The following crashes the postgresql process.
>>
>>   {{{
>>   SELECT md5(NULL::raster)
>>   }}}
>>
>>   Crash is caused in RASTER_to_bytea() where arg 0 is NULL.
>>
>>   {{{
>>   pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
>>   }}}
>
> Marking the function as STRICT should fix this.
>

I need to commit the fix from my local checkout.  Basically,

{{{
if (PG_ARGISNULL(0)) PG_RETURN_NULL();
}}}

-bborie



More information about the postgis-devel mailing list