A few issues I'd appreciate any comments on:

1) Aligned data

If I am right there is no way to portably cause the alignment of 
variables in a function declaration.  If there is, we should use
it, but if not, the SWAR code needs aligned data a lot of the
time (sometimes even align128), so it would be best if internally GGI 
provided some alignment directives e.g. GGI_ALIGN32(uint32 foo);  
Is it possible to define such a macro for all our target systems?  
What's the best example code from any other projects that have done so?

2) Pointers as integers

As above, the SWAR code often needs to do math on the integer representation
of a pointer.  Unfortunately the size of a pointer may vary, so providing
a "uintp" internal declaration would be handy. 

3) Interesting bug

A recent security bug report I read recently mentioned that a image processing
library left applications that used it open to a buffer overflow because
it multiplied the width, height depth of the image it was going to display
and then used passed value to malloc.  However, if the multiplication 
overflowed, the malloced buffer would be smaller than the progam
thought it was, thus allowing for buffer overruns.  I have no doubt there
are many places in GGI where we do something similar and a hostile
peice of data could fool an application into causing a buffer overrun
with LibGGI calls that are thought to be safe.  So be on your toes when you 
come across allocs in the source and check that sufficient memory is always
allocated to prevent GGI from internally overrunning the buffer.

--
Brian

Reply via email to