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 buffer size problem in cligen_parse_file() #49

Closed
wants to merge 1 commit into from
Closed

fix buffer size problem in cligen_parse_file() #49

wants to merge 1 commit into from

Conversation

dcornejo
Copy link
Contributor

@dcornejo dcornejo commented Jun 18, 2020

reading in a file exactly the same size as the buffer could leave the buffer not terminated with a 0 byte.

figure out the size of the file, then allocate that + 1 byte.

changed the file read to do it all in one chunk rather than byte by byte.

This change is sponsored by Rubicon Communications LLC (Netgate)

reading in a file exactly the same size as the buffer could leave
the buffer not terminated with a 0 byte. figure out the size of
the file allocate that + 1 byte. changed the file read to do it
all in one chunk rather than byte by byte.
@olofhagsand
Copy link
Member

I can see the problem. But nothing is actually read, only the memset is made on the buffer and passed to parsing a string of 0:s?

olofhagsand added a commit that referenced this pull request Jun 18, 2020
…eave the buffer not terminated with a 0 byte](#49)
@olofhagsand
Copy link
Member

Thanks for detecting. But fixed by this commit:
f8048bc

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.

2 participants