[PATCH 1/2] hesiod: fix swapped arguments in service parser
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri May 29 11:59:46 GMT 2026
On 28/05/26 17:37, H.J. Lu wrote:
> On Fri, May 29, 2026 at 4:31 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>> The port number in the service file is a decimal number followed by a
>> single slash.
>> ---
>> hesiod/nss_hesiod/hesiod-service.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hesiod/nss_hesiod/hesiod-service.c b/hesiod/nss_hesiod/hesiod-service.c
>> index 3b5c704660a..11ee302853e 100644
>> --- a/hesiod/nss_hesiod/hesiod-service.c
>> +++ b/hesiod/nss_hesiod/hesiod-service.c
>> @@ -41,7 +41,7 @@ LINE_PARSER
>> ("#",
>> STRING_FIELD (result->s_name, ISSC_OR_SPACE, 1);
>> STRING_FIELD (result->s_proto, ISSC_OR_SPACE, 1);
>
> Should 1 be true?
>
>> - INT_FIELD (result->s_port, ISSC_OR_SPACE, 10, 0, htons);
>> + INT_FIELD (result->s_port, ISSC_OR_SPACE, 0, 10, htons);
>
> Should 0 be false?
>
>> )
>>
>> enum nss_status
>> --
>> 2.43.0
I followed the same approach as Andreas did for nss [1][2]: fix
the issue with a minimal change and then refactor the code. But
I don't have a strong opinion here, I can squash the patches.
[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=66efdda2f8bce2680f5984a6bd5e488a9b528ead
[2] https://sourceware.org/git/?p=glibc.git;a=commit;h=aa56ccb98b701680ad48431fea2a1966bac7fa31
More information about the Libc-alpha
mailing list