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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Broadcom
broadcom-utils
Commits
606bc7a3
Commit
606bc7a3
authored
5 years ago
by
Ronny Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Fix an index out of bounds error.
parent
2c20ec37
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide 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)
static
int
meta_find_all
(
void
)
{
struct
ubi_vol_info
volInfo
;
int
i
,
volId
,
res
;
int
i
,
volId
,
res
,
medaIdx
;
res
=
0
;
medaIdx
=
0
;
volId
=
devInfo
.
lowest_vol_id
-
1
;
for
(
i
=
0
;
i
<
devInfo
.
vol_count
&&
volId
<
UBI_MAX_VOLUMES
;
i
++
)
{
...
...
@@ -555,21 +556,24 @@ static int meta_find_all(void)
case
METAVOLID1
:
case
METAVOLID2
:
case
METAVOLID3
:
metaInfos
[
i
].
found
=
1
;
metaInfos
[
i
].
volInfo
=
volInfo
;
metaInfos
[
i
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
metaInfos
[
i
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
if
(
meta_find_seqno
(
metaInfos
+
i
))
{
metaInfos
[
medaIdx
].
found
=
1
;
metaInfos
[
medaIdx
].
volInfo
=
volInfo
;
metaInfos
[
medaIdx
].
nodePath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
-
1
);
metaInfos
[
medaIdx
].
volPath
=
ubi_path_by_id
(
devInfo
.
dev_num
,
volInfo
.
vol_id
);
if
(
meta_find_seqno
(
metaInfos
+
medaIdx
))
{
if
(
verbose
)
{
printf
(
"Found %s in %s but it's corrupt.
\n
"
,
volInfo
.
name
,
metaInfos
[
i
].
volPath
);
volInfo
.
name
,
metaInfos
[
medaIdx
].
volPath
);
}
}
else
if
(
verbose
)
{
printf
(
"Found %s in %s, committed %d, seq %d
\n
"
,
volInfo
.
name
,
metaInfos
[
i
].
volPath
,
metaInfos
[
i
].
committed
,
metaInfos
[
i
].
seqNo
);
volInfo
.
name
,
metaInfos
[
medaIdx
].
volPath
,
metaInfos
[
medaIdx
].
committed
,
metaInfos
[
medaIdx
].
seqNo
);
}
if
(
medaIdx
<
MAX_METAS
)
medaIdx
++
;
break
;
default:
...
...
@@ -852,6 +856,7 @@ int gen_image_ubi(char *sequence_number)
metaInfos
[
i
].
volPath
=
NULL
;
}
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
register
or
sign in
to comment