X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=fs%2Fcbfs%2Fcbfs.c;h=6e1107d751bc63b7c0603bda218234c41d8cd03d;hb=c964a0dcae5c4af334881d7286ec0222640b6a17;hp=1b25a15e48848081c34c396eb7e060d150327a61;hpb=2c601c7208713ba9b2158c57adcf515f4bdbc212;p=oweals%2Fu-boot.git diff --git a/fs/cbfs/cbfs.c b/fs/cbfs/cbfs.c index 1b25a15e48..6e1107d751 100644 --- a/fs/cbfs/cbfs.c +++ b/fs/cbfs/cbfs.c @@ -1,22 +1,10 @@ /* * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ +#include #include #include #include @@ -109,8 +97,8 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align, } swap_file_header(&header, fileHeader); - if (header.offset < sizeof(const struct cbfs_cachenode *) || - header.offset > header.len) { + if (header.offset < sizeof(struct cbfs_fileheader) || + header.offset > header.len) { file_cbfs_result = CBFS_BAD_FILE; return -1; } @@ -118,9 +106,9 @@ static int file_cbfs_next_file(u8 *start, u32 size, u32 align, newNode->type = header.type; newNode->data = start + header.offset; newNode->data_length = header.len; - name_len = header.offset - sizeof(struct cbfs_cachenode *); + name_len = header.offset - sizeof(struct cbfs_fileheader); newNode->name = (char *)fileHeader + - sizeof(struct cbfs_cachenode *); + sizeof(struct cbfs_fileheader); newNode->name_length = name_len; newNode->checksum = header.checksum;