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

libdraw: fix _fontpipe's error reading #535

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jroimartin
Copy link
Contributor

_fontpipe executes fontsrv -pp for a given font name. If the font is found (the output starts with \001), the fd of fontsrv's stdout(+stderr) is returned. On the other side, if the font does not exist, a buffer is filled with the returned error and werrstr is called passing this buffer.

However, _fontpipe is not writing the read bytes into the buffer. This PR fixes that.

You can reproduce the bug executing:

% acme -f/mnt/font/invalidfont

You should see:

Before the fix

% acme -f/mnt/font/invalidfont
imageinit: can't open font /mnt/font/invalidfont: **UNINITIALIZED_MEM**
acme: can't open display: **UNINITIALIZED_MEM**

After the fix

% acme -f/mnt/font/invalidfont
imageinit: can't open font /mnt/font/invalidfont: invalidfont: file not found
acme: can't open display: invalidfont: file not found

@jroimartin
Copy link
Contributor Author

@rsc if I'm not wrong, you wrote this code. Could you review the fix? it's a one-line patch so (hopefully) it should be quick. Thanks! :)

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

1 participant