Re: [xml] reporting bug for lixml2.2.6-8
- From: Rich Salz <rsalz datapower com>
- To: Daniel Veillard <veillard redhat com>
- Cc: Pascal Rodes <prodes mail transiciel com>, "'xml gnome org'" <xml gnome org>
- Subject: Re: [xml] reporting bug for lixml2.2.6-8
- Date: Sun, 29 Aug 2004 00:54:31 -0400 (EDT)
the code. Basically given a pointer to a string the question is whether
that string comes from the dictionnary. To check that the pointer is compared
to the upper and lower bounds of the memory areas used by the dictionnary.
The pointers are unrelated, that's true, str could come from static memory
heap or stack and not being related to the dictionnaries allocated from heap
the comparison is still legal, harmless and the right thing to do in that case.
It's also very cheap, i.e. fast.
Being pedantic, you're not allowed to do "ordering tests" on pointers
unless you are sure they are related. At least not in ANSI/ISO C.
You'd have to explicit check for == or != against every pointer in
the dictionary.
Perhaps someone will offer a patch that does something like
#define POINTER_WITHIN(ptr, lo, hi) \
(ptr >= lo && ptr <= ho)
else
int pointer_within(void* ptr, void* lo, void* hi)
{
char* lop = lo;
char* hip = hi;
while (lop <= hip)
if (ptr == (void*)lop++) return 1;
return 0;
}
you get the idea...
/r$
--
Rich Salz Chief Security Architect
DataPower Technology http://www.datapower.com
XS40 XML Security Gateway http://www.datapower.com/products/xs40.html
XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]