diff options
| author | Borislav Petkov <[email protected]> | 2016-06-06 17:10:44 +0200 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2016-06-08 11:04:19 +0200 |
| commit | 7557933e6b99d381c19b196901ed537b00f6d121 (patch) | |
| tree | ad44428540f33df71b41daa475423f99685e3586 | |
| parent | 4b703305d98bf7350d4b2953ee39a3aa2eeb1778 (diff) | |
lib/cpio: Make find_cpio_data()'s offset arg optional
Some callers don't use it so make it optional.
Signed-off-by: Borislav Petkov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Brian Gerst <[email protected]>
Cc: Denys Vlasenko <[email protected]>
Cc: H. Peter Anvin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
| -rw-r--r-- | lib/earlycpio.c | 5 |
1 files changed, 4 insertions, 1 deletions
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", |