Function
FwupdPluginmemmem_safe
since: 1.8.2
Declaration [src]
gboolean
fu_memmem_safe (
const guint8* haystack,
gsize haystack_sz,
const guint8* needle,
gsize needle_sz,
gsize* offset,
GError** error
)
Description [src]
Finds a block of memory in another block of memory in a safe way.
Available since: 1.8.2
Parameters
haystack-
Type:
const guint8*Destination buffer.
The data is owned by the caller of the function. haystack_sz-
Type:
gsizeMaximum size of
haystack, typicallysizeof(haystack) needle-
Type:
const guint8*Source buffer.
The data is owned by the caller of the function. needle_sz-
Type:
gsizeMaximum size of
haystack, typicallysizeof(needle) offset-
Type:
gsize*Offset in bytes
needlehas been found inhaystack.The argument will be set by the function. The argument can be set to NULLby the function. error-
Type:
GError **The return location for a recoverable error.
The argument can be NULL.If the return location is not NULL, then you must initialize it to aNULLGError*.The argument will left initialized to NULLby the function if there are no errors.In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.