mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
typefind: remove pointless checks for data being NULL
It was already checked in an early out, and as it's only incremented for at most the size of the passed buffer, it can only become NULL in an address wraparound. While there, don't cast away const on a pointer. Coverity 1139845
This commit is contained in:
parent
9e99a1ca41
commit
577ec29245
1 changed files with 2 additions and 2 deletions
|
@ -517,7 +517,7 @@ xml_check_first_element_from_data (const guint8 * data, guint length,
|
|||
|
||||
/* look for the first element, it has to be the requested element. Bail
|
||||
* out if it is not within the first 4kB. */
|
||||
while (data && pos < MIN (4096, length)) {
|
||||
while (pos < MIN (4096, length)) {
|
||||
while (*data != '<' && pos < MIN (4096, length)) {
|
||||
XML_INC_BUFFER_DATA;
|
||||
}
|
||||
|
@ -533,7 +533,7 @@ xml_check_first_element_from_data (const guint8 * data, guint length,
|
|||
/* the first normal element, check if it's the one asked for */
|
||||
if (pos + elen + 1 >= length)
|
||||
return FALSE;
|
||||
return (data && element && strncmp ((char *) data, element, elen) == 0);
|
||||
return (element && strncmp ((const char *) data, element, elen) == 0);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue