Re: Bad malloc (?)

2012-09-02 Thread rustyBSD
Le 01/09/2012 19:59, Kenneth R Westerback a écrit : On Sat, Sep 01, 2012 at 07:19:25PM +0200, rustyBSD wrote: Hi, in /usr/src/sbin/scsi/scsi.c line 225, why is the malloc not checked ? ... If it fails, it overflows, no ? Crufty old code. Feel free to submit an actual diff! Note there seem

Re: Bad malloc (?)

2012-09-02 Thread Kenneth R Westerback
On Sun, Sep 02, 2012 at 02:27:57PM +0200, rustyBSD wrote: Le 01/09/2012 19:59, Kenneth R Westerback a ?crit : On Sat, Sep 01, 2012 at 07:19:25PM +0200, rustyBSD wrote: Hi, in /usr/src/sbin/scsi/scsi.c line 225, why is the malloc not checked ? ... If it fails, it overflows, no ?

Re: Bad malloc (?)

2012-09-02 Thread Alexander Hall
On 09/02/12 14:42, Kenneth R Westerback wrote: On Sun, Sep 02, 2012 at 02:27:57PM +0200, rustyBSD wrote: Le 01/09/2012 19:59, Kenneth R Westerback a ?crit : On Sat, Sep 01, 2012 at 07:19:25PM +0200, rustyBSD wrote: Hi, in /usr/src/sbin/scsi/scsi.c line 225, why is the malloc not checked ? ...

Re: Bad malloc (?)

2012-09-02 Thread rustyBSD
Le 02/09/2012 14:57, Alexander Hall a écrit : Whoever it is, I'm sure he or she appreciate diffs anyway! Ok, here is one. [demime 1.01d removed an attachment of type text/x-patch which had a name of scsi.c.diff]

Re: Bad malloc (?)

2012-09-02 Thread rustyBSD
Le 02/09/2012 16:06, rustyBSD a écrit : [demime 1.01d removed an attachment of type text/x-patch which had a name of scsi.c.diff] Mmhhh... --- scsi.cSun Sep 2 15:47:45 2012 +++ scsi.cSun Sep 2 16:00:42 2012 @@ -223,6 +223,7 @@ case 'z': { char *p =

Re: Bad malloc (?)

2012-09-02 Thread Otto Moerbeek
On Sun, Sep 02, 2012 at 04:18:17PM +0200, rustyBSD wrote: Le 02/09/2012 16:06, rustyBSD a ?crit : [demime 1.01d removed an attachment of type text/x-patch which had a name of scsi.c.diff] Mmhhh... --- scsi.cSun Sep 2 15:47:45 2012 +++ scsi.cSun Sep 2 16:00:42 2012 @@ -223,6

Re: Bad malloc (?)

2012-09-02 Thread rustyBSD
Le 02/09/2012 20:36, Otto Moerbeek a écrit : Confusing errno and exit code. Just use 1. Or err(1, NULL). The default message is clear enough. I use errno because most of other calls to err() in this file use errno too.

Re: Bad malloc (?)

2012-09-02 Thread Otto Moerbeek
On Sun, Sep 02, 2012 at 09:18:02PM +0200, rustyBSD wrote: Le 02/09/2012 20:36, Otto Moerbeek a ?crit : Confusing errno and exit code. Just use 1. Or err(1, NULL). The default message is clear enough. I use errno because most of other calls to err() in this file use errno too. Then those

Re: Bad malloc (?)

2012-09-02 Thread Kenneth R Westerback
On Sun, Sep 02, 2012 at 08:36:57PM +0200, Otto Moerbeek wrote: On Sun, Sep 02, 2012 at 04:18:17PM +0200, rustyBSD wrote: Le 02/09/2012 16:06, rustyBSD a ?crit : [demime 1.01d removed an attachment of type text/x-patch which had a name of scsi.c.diff] Mmhhh... --- scsi.cSun

Bad malloc (?)

2012-09-01 Thread rustyBSD
Hi, in /usr/src/sbin/scsi/scsi.c line 225, why is the malloc not checked ? ... If it fails, it overflows, no ?

Re: Bad malloc (?)

2012-09-01 Thread Kenneth R Westerback
On Sat, Sep 01, 2012 at 07:19:25PM +0200, rustyBSD wrote: Hi, in /usr/src/sbin/scsi/scsi.c line 225, why is the malloc not checked ? ... If it fails, it overflows, no ? Crufty old code. Feel free to submit an actual diff! Note there seem to be 2 non-checked malloc returns. Ken