[10117] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] bug in glib.h / g_bit_nth_msf

daemon@ATHENA.MIT.EDU (Andreas Bombe)
Sat Nov 14 21:44:51 1998

Date: Sun, 15 Nov 1998 03:38:59 +0100
From: Andreas Bombe <andreasb@munich.netsurf.de>
To: gtk-list@redhat.com
Reply-To: Andreas Bombe <andreas.bombe@munich.netsurf.de>
Resent-From: gtk-list@redhat.com

I found an off-by-one error in glib.h in the g_bit_nth_msf macro.  It sets
nth_bit to 33 in case it's called with nth_bit < 0.  This value is reduced by
one immediately thereafter, but 1<<32 is off limits for a 32 bit variable.
Also nth_bit shouldn't be checked for <0 but <1.

-- 
Andreas E. Bombe <andreas.bombe@munich.netsurf.de>
http://home.pages.de/~andreas.bombe/

PGP 1024bit ID:0x886663c9 fingerprint: 30EC0973847B5583 C47A91D99DC54BB0
    2048bit ID:0xF62D5CC1 fingerprint: 136BBC1536B8B77A 200558E86FAAF8ED

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post