Github messages for voidlinux
 help / color / mirror / Atom feed
From: balejk <balejk@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: musl: backport patch to fix fgetws
Date: Fri, 15 Dec 2023 21:31:29 +0100	[thread overview]
Message-ID: <20231215203129.JJT3mFtGHZ8hBxeJgpH3PWpjpDpYanmoHQwwNyhfrLI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45617@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 2873 bytes --]

New comment by balejk on void-packages repository

https://github.com/void-linux/void-packages/pull/45617#issuecomment-1858452021

Comment:
This is not stale, I can still reproduce the issue.

To add some context, I discovered this when running aerc's test suite, which
also tests a C program for wrapping emails. This test failed because the
program only wrapped part of the text and stripped the rest because fgetws did
not correctly recognize EOF.

Below is a minimal working example along with the test text courtesy of aerc:
```c
#include <stdio.h>
#include <wchar.h>
#include <stdbool.h>
#include <locale.h>

#define BUFFER_SIZE 8192

int main() {
	FILE *in = fopen("mwe.in", "r");
	wchar_t buf[BUFFER_SIZE];
	setlocale(LC_ALL, "");
	while (fgetws(buf, BUFFER_SIZE, in)) {
		fwprintf(stdout, buf);
	}
	fclose(in);
	return 0;
}
```
```
Λορεμ ιπσθμ δολορ σιτ αμετ, ρεβθμ φαλλι γραεcισ θτ θσθ, θσθ ομνισ μοδθσ ατομορθμ ει, δθο εραντ πραεσεντ νο. Εξ εθμ μολεστιαε ιντελλεγαμ, σεα λαβιτθρ αλιενθμ τε. Θσθ αν τεμπορ φορενσιβθσ, σιτ διcτα διcερετ ποσιδονιθμ ατ. Σενσεριτ δισσεντιθντ ει μελ, φεθγιατ πλαcερατ περ cθ. Εα σιτ μοδθσ νονθμυ μελιορε, ιντεγρε θλλαμcορπερ νε cθμ. Εα νεc σαεπε μανδαμθσ, qθισ vολθπτθα cονσθλατθ νο vελ. Ηισ cθ νεμορε ποσσιμ.

Αν προ φαcερ αργθμεντθμ, ατ μαλορθμ ιμπερδιετ ιντελλεγαμ θσθ, αδ πρι λθcιλιθσ σcριπσεριτ. Θσθ ιν σολθμ διcατ δεμοcριτθμ, σιμθλ σcριπσεριτ εθ μει, vιξ εξ ειρμοδ αccθσατα. Qθι ιμπεδιτ cοπιοσαε ιμπερδιετ εα, αφφερτ ορνατθσ ηισ εθ, αεqθε τολλιτ cονσεcτετθερ νε προ! Ιπσθμ σεντεντιαε ετ προ, αθτεμ σθαvιτατε cονστιτθαμ εξ qθι? Ταντασ λεγερε qθι ιδ?

Θσθ νισλ νιηιλ ηενδρεριτ τε! Ιπσθμ νθσqθαμ ιθσ εξ? Ηισ αν ιπσθμ λατινε δισσεντιθντ. Vιμ αλιqθιδ τεμποριβθσ vολθπτατιβθσ αδ, αδ πρι δομινγ απεριρι δισπθτατιονι. Vιμ σθμμο αφφερτ εα, νονθμυ ποσσιτ φαβθλασ ατ εστ.
```

Save the above text as `mwe.in` and execute the above program within the same directory. Only part of the text will get printed back.

This could potentially lead to some information loss for people who use this program (`wrap`) with aerc on musl because it could strip out part of a received message while wrapping it.


  parent reply	other threads:[~2023-12-15 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15 20:35 [PR PATCH] " balejk
2023-08-17 14:22 ` [PR PATCH] [Updated] " balejk
2023-08-30 17:36 ` balejk
2023-09-10 10:52 ` balejk
2023-12-10  1:48 ` github-actions
2023-12-15 20:31 ` balejk [this message]
2024-01-13 17:37 ` [PR PATCH] [Updated] " balejk
2024-04-13  1:39 ` github-actions
2024-04-27  1:45 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231215203129.JJT3mFtGHZ8hBxeJgpH3PWpjpDpYanmoHQwwNyhfrLI@z \
    --to=balejk@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).