mirror of
https://github.com/python/cpython.git
synced 2025-11-10 22:36:18 +00:00
Handle failures from lookup.
Klocwork 341-342
This commit is contained in:
parent
ee7c8f9af8
commit
26a8abf1f4
1 changed files with 4 additions and 0 deletions
|
|
@ -2795,6 +2795,8 @@ storeAtts(XML_Parser parser, const ENCODING *enc,
|
||||||
unsigned long uriHash = 0;
|
unsigned long uriHash = 0;
|
||||||
((XML_Char *)s)[-1] = 0; /* clear flag */
|
((XML_Char *)s)[-1] = 0; /* clear flag */
|
||||||
id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0);
|
id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, s, 0);
|
||||||
|
if (!id)
|
||||||
|
return XML_ERROR_NO_MEMORY;
|
||||||
b = id->prefix->binding;
|
b = id->prefix->binding;
|
||||||
if (!b)
|
if (!b)
|
||||||
return XML_ERROR_UNBOUND_PREFIX;
|
return XML_ERROR_UNBOUND_PREFIX;
|
||||||
|
|
@ -5340,6 +5342,8 @@ getAttributeId(XML_Parser parser, const ENCODING *enc,
|
||||||
return NULL;
|
return NULL;
|
||||||
id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
|
id->prefix = (PREFIX *)lookup(&dtd->prefixes, poolStart(&dtd->pool),
|
||||||
sizeof(PREFIX));
|
sizeof(PREFIX));
|
||||||
|
if (!id->prefix)
|
||||||
|
return NULL;
|
||||||
if (id->prefix->name == poolStart(&dtd->pool))
|
if (id->prefix->name == poolStart(&dtd->pool))
|
||||||
poolFinish(&dtd->pool);
|
poolFinish(&dtd->pool);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue