From: realtime-neil Date: Mon, 25 Jan 2021 22:44:07 +0000 (+0000) Subject: fix(skipcpio): edit skipcpio.c: strstr -> memmem X-Git-Tag: 052~130 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68dd8af21d34c5c2cb8631f7c02c6a6cf1aa6122;p=thirdparty%2Fdracut.git fix(skipcpio): edit skipcpio.c: strstr -> memmem because CPIO_END might follow a NULL byte in buf --- diff --git a/skipcpio/skipcpio.c b/skipcpio/skipcpio.c index 30699816d..dea216c57 100644 --- a/skipcpio/skipcpio.c +++ b/skipcpio/skipcpio.c @@ -72,7 +72,7 @@ int main(int argc, char **argv) if (s <= 0) break; - h = strstr(buf, CPIO_END); + h = memmem(buf, sizeof(buf), CPIO_END, sizeof(CPIO_END)); if (h) { pos = (h - buf) + pos + CPIO_ENDLEN; fseek(f, pos, SEEK_SET);