X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=lib%2Fearlycpio.c;h=db283ba4d2c1fb5041180fe712781c3138b7ae9a;hb=8ab293e3a1376574e11f9059c09cc0db212546cb;hp=3eb3e4722b8ee3599e63c92dee1d14c6aece4a37;hpb=68cf8d0c720cdb76dc912c983d8dae9de6d6e5cf;p=deliverable%2Flinux.git diff --git a/lib/earlycpio.c b/lib/earlycpio.c index 3eb3e4722b8e..db283ba4d2c1 100644 --- a/lib/earlycpio.c +++ b/lib/earlycpio.c @@ -125,7 +125,10 @@ struct cpio_data find_cpio_data(const char *path, void *data, if ((ch[C_MODE] & 0170000) == 0100000 && ch[C_NAMESIZE] >= mypathsize && !memcmp(p, path, mypathsize)) { - *nextoff = (long)nptr - (long)data; + + if (nextoff) + *nextoff = (long)nptr - (long)data; + if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) { pr_warn( "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",