Skip to content

fix(roller): fix stringop overflow - #6826

Merged
XuNeo merged 1 commit into
lvgl:masterfrom
FASTSHIFT:fix_roller_stringop_overflow
Sep 11, 2024
Merged

XuNeo merged 1 commit into
lvgl:masterfrom
FASTSHIFT:fix_roller_stringop_overflow

Conversation

@FASTSHIFT

Copy link
Copy Markdown
Collaborator
lvgl/src/widgets/roller/lv_roller.c:130:55: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  130 |         opt_extra[opt_len * roller->inf_page_cnt - 1] = '\0';
      |                                                       ^
../../../mm/umm_heap/umm_malloc.c:64:9: note: at offset -1 into destination object of size [0, 2147483647] allocated by 'mm_malloc'
   64 |   ret = mm_malloc(USR_HEAP, size);
      |         ^

A clear and concise description of what the bug or new feature is.

Notes

```bash
lvgl/src/widgets/roller/lv_roller.c:130:55: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
  130 |         opt_extra[opt_len * roller->inf_page_cnt - 1] = '\0';
      |                                                       ^
../../../mm/umm_heap/umm_malloc.c:64:9: note: at offset -1 into destination object of size [0, 2147483647] allocated by 'mm_malloc'
   64 |   ret = mm_malloc(USR_HEAP, size);
      |         ^
```

Signed-off-by: pengyiqiang <[email protected]>

@kissa96 kissa96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liamHowatt liamHowatt left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it can never happen, though? I know you need to convince stringop-overflow, but still.

@FASTSHIFT

Copy link
Copy Markdown
Collaborator Author

It looks like it can never happen, though?

Yes

@XuNeo
XuNeo merged commit 7fcab92 into lvgl:master Sep 11, 2024
@FASTSHIFT
FASTSHIFT deleted the fix_roller_stringop_overflow branch September 12, 2024 06:31
kisvegabor pushed a commit to kisvegabor/lvgl_fork that referenced this pull request Oct 1, 2024
Signed-off-by: pengyiqiang <[email protected]>
Co-authored-by: pengyiqiang <[email protected]>
kisvegabor pushed a commit that referenced this pull request Oct 9, 2024
Signed-off-by: pengyiqiang <[email protected]>
Co-authored-by: pengyiqiang <[email protected]>
rodb70 pushed a commit to rodb70/lvgl that referenced this pull request Nov 8, 2024
Signed-off-by: pengyiqiang <[email protected]>
Co-authored-by: pengyiqiang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants