Re: buffer sizes and null pointers

2002-06-07 Thread David Richard Larochelle
Null pointers and buffer sizes are a tricky issue. The bounds checking code isn't to detect bounds accesses of null pointers. (There is of course separate null terminated checking in splint.) There are enough library function that use the convention maxSet(ptr) > N or ptr == NULL. I think

buffer sizes and null pointers

2002-05-26 Thread Ken Raeburn
I'm trying to annotate getnameinfo, which takes among its inputs two buffer pointers and their lengths. Each buffer pointer can be null if the supplied length for it is zero. I don't see a way to indicate that a maxSet relationship need only hold if the size is nonzero. Perhaps maxSet(NULL) ==

Re: buffer sizes and null pointers

2002-05-26 Thread Ken Raeburn
I wrote: > I don't see a way to indicate that a maxSet relationship need only > hold if the size is nonzero. Perhaps maxSet(NULL) == 0 should be > assumed? Nope, silly me, I keep thinking "how many" when I should be thinking "max index", so 0 is no good, it means one location can be set. Perhaps