Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
broadcom-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This project is archived. Its data is
read-only
.
Show more breadcrumbs
Broadcom
broadcom-utils
Commits
606bc7a3
Commit
606bc7a3
authored
Oct 3, 2019
by
Ronny Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Fix an index out of bounds error.
parent
2c20ec37
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
brcm_fw_tool/image-ubi.c
+14
-9
14 additions, 9 deletions
brcm_fw_tool/image-ubi.c
with
14 additions
and
9 deletions
brcm_fw_tool/image-ubi.c
+
14
−
9
View file @
606bc7a3
...
@@ -536,9 +536,10 @@ static struct metaInfo_t* meta_by_id(int id)
...
@@ -536,9 +536,10 @@ static struct metaInfo_t* meta_by_id(int id)
static
int
meta_find_all
(
void
)
static
int
meta_find_all
(
void
)
{
{
struct
ubi_vol_info
volInfo
;
struct
ubi_vol_info
volInfo
;
int
i
,
volId
,
res
;
int
i
,
volId
,
res
,
medaIdx
;
res
=
0
;
res
=
0
;
medaIdx
=
0
;
volId
=
devInfo
.
lowest_vol_id
-
1
;
volId
=
devInfo
.
lowest_vol_id
-
1
;
for
(
i
=
0
;
i
<
devInfo
.
vol_count
&&
volId
<
UBI_MAX_VOLUMES
;
i
++
)
{
for
(
i
=
0
;
i
<
devInfo
.
vol_count
&&
volId
<
UBI_MAX_VOLUMES
;
i
++
)
{
...
@@ -555,21 +556,24 @@ static int meta_find_all(void)
...
@@ -555,21 +556,24 @@ static int meta_find_all(void)
case
METAVOLID1
:
case
METAVOLID1
:
case
METAVOLID2
:
case
METAVOLID2
:
case
METAVOLID3
:
case
METAVOLID3
:
metaInfos
[
i
].
found
=
1
;
metaInfos
[
medaIdx
].
found
=
1
;
metaInfos
[
i
].
volInfo
=
volInfo
;
metaInfos
[
medaIdx
].
volInfo
=
volInfo
;
metaInfos
[
i
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
metaInfos
[
medaIdx
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
metaInfos
[
i
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
metaInfos
[
medaIdx
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
if
(
meta_find_seqno
(
metaInfos
+
i
))
{
if
(
meta_find_seqno
(
metaInfos
+
medaIdx
))
{
if
(
verbose
)
{
if
(
verbose
)
{
printf
(
"Found %s in %s but it's corrupt.
\n
"
,
printf
(
"Found %s in %s but it's corrupt.
\n
"
,
volInfo
.
name
,
metaInfos
[
i
].
volPath
);
volInfo
.
name
,
metaInfos
[
medaIdx
].
volPath
);
}
}
}
}
else
if
(
verbose
)
{
else
if
(
verbose
)
{
printf
(
"Found %s in %s, committed %d, seq %d
\n
"
,
printf
(
"Found %s in %s, committed %d, seq %d
\n
"
,
volInfo
.
name
,
metaInfos
[
i
].
volPath
,
volInfo
.
name
,
metaInfos
[
medaIdx
].
volPath
,
metaInfos
[
i
].
committed
,
metaInfos
[
i
].
seqNo
);
metaInfos
[
medaIdx
].
committed
,
metaInfos
[
medaIdx
].
seqNo
);
}
}
if
(
medaIdx
<
MAX_METAS
)
medaIdx
++
;
break
;
break
;
default:
default:
...
@@ -852,6 +856,7 @@ int gen_image_ubi(char *sequence_number)
...
@@ -852,6 +856,7 @@ int gen_image_ubi(char *sequence_number)
metaInfos
[
i
].
volPath
=
NULL
;
metaInfos
[
i
].
volPath
=
NULL
;
}
}
libubi_close
(
libubi
);
libubi_close
(
libubi
);
libubi
=
NULL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment