Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file_lock_write #219

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

pkopylov
Copy link

The implementation of the function file_lock_write() looks slightly strange. The library function g_strdup() used inside doesn't consider the length of the duplicated data. However, the size of the data parameter is restricted by the third parameter len, so its value must limit the number of bytes copied during duplication.

That patch corrects the test function inc_counter(), but it looks suspicious to me because it terminates the character value by a zero character instead of checking how the function file_lock_write() works in case the len parameter equals one and a string is not terminated by a zero character.

@pkopylov pkopylov changed the title Fix file lock write Fix file_lock_write Apr 10, 2023
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.

1 participant