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

eflite: init at 0.4.1 #23336

Closed
wants to merge 4 commits into from
Closed

eflite: init at 0.4.1 #23336

wants to merge 4 commits into from

Conversation

jhhuh
Copy link
Contributor

@jhhuh jhhuh commented Mar 1, 2017

Motivation for this change

New package added. All the patches are from the corresponding debian package.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@jhhuh, thanks for your PR! By analyzing the history of the files in this pull request, we identified @zraexy, @zimbatm and @peti to be potential reviewers.


if ((flags & 0xffff) > DEBUG) return;
- sprintf(logname, "%s/es.log", getenv("HOME"));
+ sprintf(logname, sizeof(logname), "%s/es.log", getenv("HOME"));
Copy link
Member

@Mic92 Mic92 Mar 2, 2017

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Member

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);
Copy link
Member

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)?

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.

None yet

3 participants