Re: [wmii] Small bugs in fs.c (patch)

From: Anselm R. Garbe <garbeam_AT_wmii.de>
Date: Fri, 26 May 2006 10:00:17 +0200

On Thu, May 25, 2006 at 11:48:52PM -0400, Chris King wrote:
> When compiling wmii under OS X (Intel) I found a segfault in
> cmd/wm/fs.h. The OS X linker is confusing the "err" symbol in
> cmd/wm/fs.h with the "err" function in libc. Attached is a patch to
> fix that as well as a few off-by-one bounds-check errors I found while
> tracking it down. Otherwise wmii compiles and runs beautifully under
> OS X; great job Anselm and everyone!

Thanks for the err hint, I renamed it into errstr for wmii-3.1
and in wmii-current.

But I cannot agree on the off-by-one bounds checks.

- if(fcall->count > sizeof(buf))
+ if(fcall->count > sizeof(buf) - 1)

This is wrong, because fcall->count is not an array index, but
indicates the size of data. Also it is no string, thus there are
no 0-termination issues.

Regards,

-- 
 Anselm R. Garbe  ><><  www.ebrag.de  ><><  GPG key: 0D73F361
Received on Fri May 26 2006 - 10:00:17 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:06:56 UTC