MCPcopy Create free account
hub / github.com/apache/httpd / ap_lua_binstrstr

Function ap_lua_binstrstr

modules/lua/lua_request.c:365–377  ·  view source on GitHub ↗

ap_lua_binstrstr: Binary strstr function for uploaded data with NULL bytes */

Source from the content-addressed store, hash-verified

363
364/* ap_lua_binstrstr: Binary strstr function for uploaded data with NULL bytes */
365static char* ap_lua_binstrstr (const char * haystack, size_t hsize, const char* needle, size_t nsize)
366{
367 size_t p;
368 if (haystack == NULL) return NULL;
369 if (needle == NULL) return NULL;
370 if (hsize < nsize) return NULL;
371 for (p = 0; p <= (hsize - nsize); ++p) {
372 if (memcmp(haystack + p, needle, nsize) == 0) {
373 return (char*) (haystack + p);
374 }
375 }
376 return NULL;
377}
378
379/* r:parsebody(): Parses regular (url-enocded) or multipart POST data and returns two tables*/
380static int req_parsebody(lua_State *L)

Callers 1

req_parsebodyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected