Skip to content

Comments

ps.map: Fix copy into fixed size buffer issue in do_scalebar.c file#4307

Merged
nilason merged 7 commits intoOSGeo:mainfrom
ShubhamDesai:issue_43
Sep 12, 2024
Merged

ps.map: Fix copy into fixed size buffer issue in do_scalebar.c file#4307
nilason merged 7 commits intoOSGeo:mainfrom
ShubhamDesai:issue_43

Conversation

@ShubhamDesai
Copy link
Contributor

This pull request resolves a buffer overflow issue detected by Coverity Scan (CID 1208259).
strcpy is replaced with G_strlcpy

@github-actions github-actions bot added C Related code is in C module labels Sep 11, 2024
ShubhamDesai and others added 2 commits September 11, 2024 19:30
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

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

Besides the inline comment, there is only one minor suggestion:

You have, in this case correctly decided, to silence most of the return values with void, I think you can do the same with the remaining one.

The value of

int G_database_unit(void)

is guaranteed to fit into a buffer of size 50.

@ShubhamDesai
Copy link
Contributor Author

Besides the inline comment, there is only one minor suggestion:

You have, in this case correctly decided, to silence most of the return values with void, I think you can do the same with the remaining one.

The value of

int G_database_unit(void)

is guaranteed to fit into a buffer of size 50.

Done

@nilason nilason added this to the 8.5.0 milestone Sep 12, 2024
@nilason nilason enabled auto-merge (squash) September 12, 2024 21:03
@nilason nilason merged commit d77f457 into OSGeo:main Sep 12, 2024
Mahesh1998 pushed a commit to Mahesh1998/grass that referenced this pull request Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C Related code is in C module

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants