Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4135 closed defect (fixed)

SIGFPE / Division by zero in mapio.c

Reported by: fake Owned by: sdlime
Priority: normal Milestone:
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords:
Cc: warmerdam

Description

when rendering jpegs from a raster, for some reason i have yet to determine, in a call to msIO_fwrite, size is 0. this causes a division by zero at the method's return statement:

             return msIO_contextWrite( context, data, size * nmemb ) / size;

this is line 457 in trunk (rev. 12907).

it would be wise to check if size is 0 before dividing by it, right?

Change History (3)

comment:1 by warmerdam, 12 years ago

Resolution: fixed
Status: newclosed

Patched in trunk (r12908) in both read and write cases.

It is hard for me to judge if this is serious enough to back port or not.

comment:2 by warmerdam, 12 years ago

Cc: warmerdam added

comment:3 by sdlime, 12 years ago

Probably should be patched in the 6.0 and 5.6 branches since it's such an easy fix. We'll likely see releases in both of those again.

Steve

Note: See TracTickets for help on using tickets.