[glibc] nss_files: fix swapped arguments in service parser

Andreas Schwab via Glibc-cvs <[email protected]> Tue, 19 May 2026 13:21:40 +0000 (GMT)
Newsgroups gmane.comp.lib.glibc.cvs
Message-ID <[email protected]>
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=66efdda2f8bce2680f5984a6bd5e488a9b528ead

commit 66efdda2f8bce2680f5984a6bd5e488a9b528ead
Author: Andreas Schwab <[email protected]>
Date:   Tue May 19 11:39:15 2026 +0200

    nss_files: fix swapped arguments in service parser
    
    The port number in the service file is a decimal number followed by a
    single slash.

Diff:
---
 nss/nss_files/files-service.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
index 1bff1a2ab6..2ba48b798d 100644
--- a/nss/nss_files/files-service.c
+++ b/nss/nss_files/files-service.c
@@ -32,7 +32,7 @@ struct servent_data {};
 LINE_PARSER
 ("#",
  STRING_FIELD (result->s_name, isspace, 1);
- INT_FIELD (result->s_port, ISSLASH, 10, 0, htons);
+ INT_FIELD (result->s_port, ISSLASH, 0, 10, htons);
  STRING_FIELD (result->s_proto, isspace, 1);
  )