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

fgwrite: Fix definition of card size #1

Merged
merged 1 commit into from
Jun 12, 2018
Merged

fgwrite: Fix definition of card size #1

merged 1 commit into from
Jun 12, 2018

Conversation

olebole
Copy link
Member

@olebole olebole commented Jun 6, 2018

The card string is used in a getcwd(card, SZ_PATHNAME) call. The man page of getcwd (3) says:

char *getcwd(char *buf, size_t size);
[...] The size argument is the size in bytes of the character array pointed to by the buf argument.

SZ_PATHNAME is set to 511; however card had only 256 chars. With hardening enabled, this results in a segmentation fault on Debian.

This patch just increases the size of card to the necessary value.

The `card` string is used in a `getcwd(card, SZ_PATHNAME)` call. The
man page or getcwd says however:

> char *getcwd(char *buf, size_t size);
> [...]
> The size argument is the size in bytes of the character array pointed
> to by the buf argument.

`SZ_PATHNAME` is set to 511; however `card` had only 256 chars. With
hardening enabled, this lead to a segmentation fault.

This patch just increases the size of `card` to the necessary value.
@olebole olebole merged commit 6c4e3c3 into master Jun 12, 2018
@olebole olebole deleted the fix_fgwrite branch July 3, 2018 13:47
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