[cups.development] malloc without NULL check

Jon Peatfield J.S.Peatfield at damtp.cam.ac.uk
Mon May 26 03:55:18 PDT 2008


On Sat, 24 May 2008, Michael Sweet wrote:

> andreas moroder wrote:
>> ...
>> and more in other places in cups-1.4svn-r7613
>
> First, a NULL will just cause the filter to crash, stopping the job.
>
> Second, if malloc() fails there is nothing we'll be able to do other
> than exit with a non-zero exit status, stopping the job.

It could 'hold' (or delay?) the job(s) and/or log a message perhaps 
explaining how much memory had been allocated (so far) and how much was 
being requested when it ran out...

If multiple jobs are being processed at the same time it might be that 
the job would have succeeded if there had been fewer allowed to run.

[ I don't think it is a big problem, but there are things that the admin 
could do if they know that this is happening - eg adding more memory/swap 
or changing the config. ]

-- 
Jon Peatfield,  Computer Officer,  DAMTP,  University of Cambridge
Mail:  jp107 at damtp.cam.ac.uk     Web:  http://www.damtp.cam.ac.uk/





More information about the cups mailing list