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

Upgrade to a safer string library #129

Open
we7u opened this issue May 17, 2019 · 2 comments
Open

Upgrade to a safer string library #129

we7u opened this issue May 17, 2019 · 2 comments

Comments

@we7u
Copy link
Member

we7u commented May 17, 2019

The string functions in the standard C library are lacking as well as unsafe: Some can't guarantee strings will be null-terminated, some can write past the end of buffers, overwriting other data structures or code. In the past we attempted to make string operations a bit safer by using xastir/src/snprintf.c. It was a step in the right direction but didn't go far enough. Newer compilers show hundreds of possible issues in string operations with the current Xastir code.

I propose we look for a better string library, replacing most/all of our string operations with said library. My initial proposal to the other Xastir admins was Better String Library but that may require extensive changes to the code to implement. Some current contenders (not an exhaustive list):

Here's an article comparing some of the above and listing more yet: String library comparison. Comments are welcome from anyone who has used string libraries in place of the standard C library functions.

If people feel that it'd be best to avoid the c-library functions that have inherent problems and use the safer c-lib functions (perhaps with wrappers to we can keep track of buffer length and assure we always get terminating zeroes), let us know that too.

@we7u
Copy link
Member Author

we7u commented May 21, 2019

Section 6 of this is a very good read:
Secure Programming HOWTO
plus check out the man-page for asprintf() / vasprintf() which look like good additional functions to use, mentioned in section 6.2.4 of the above link.

@tvrusso
Copy link
Member

tvrusso commented Feb 23, 2020

While I understand why this issue was opened, I think it should be removed as a blocker to the next release. It's still listed in the ToDo column of https://github.com/Xastir/Xastir/projects/2.

@tvrusso tvrusso removed this from To do in Release 2.2.0 Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants