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
eflite: init at 0.4.1 #23336
eflite: init at 0.4.1 #23336
Conversation
|
||
if ((flags & 0xffff) > DEBUG) return; | ||
- sprintf(logname, "%s/es.log", getenv("HOME")); | ||
+ sprintf(logname, sizeof(logname), "%s/es.log", getenv("HOME")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the right function, it should be snprintf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, you are absolutely right. This might be the reason why eflite didn't give me a debug message that README file promised. Let me test it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, do you think we should avoid blindly adopting patches from other distro, like Debian?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mic92 The line was not responsible for the command line option "-d" I mentioned, but related to DEBUG flags in compile time. Indeed the use of wrong function "sprintf" causes a segment fault when we turn on the DEBUG flag.
Now an optional argument "debug" is added to control the DEBUG flag, and I also added another patch to avoid "format-security" error in the debug mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhhuh yes, we should only apply necessary patches, where we understand the consequences.
Preferable patches were already commited by upstream in their version control.
if (flags & LOG_STDERR) | ||
{ | ||
- fprintf(stderr, buf); | ||
+ fprintf(stderr, "%s", buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about fputs(buf, stderr)
?
Motivation for this change
New package added. All the patches are from the corresponding debian package.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)