From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 4D6BD23BD6 for ; Tue, 5 Nov 2024 02:06:49 +0100 (CET) Received: (qmail 17479 invoked by uid 550); 5 Nov 2024 01:06:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com x-ms-reactions: disallow Received: (qmail 17441 invoked from network); 5 Nov 2024 01:06:44 -0000 From: To: CC: Date: Tue, 5 Nov 2024 09:06:33 +0800 Message-ID: <20241105010633.1512010-1-lihua.zhao.cn@windriver.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Authority-Analysis: v=2.4 cv=T7feTOKQ c=1 sm=1 tr=0 ts=67296f9b cx=c_pps a=K4BcnWQioVPsTJd46EJO2w==:117 a=K4BcnWQioVPsTJd46EJO2w==:17 a=VlfZXiiP6vEA:10 a=t7CeM3EgAAAA:8 a=_ZDyDUQrH_R5ImLkfx8A:9 a=zgiPjhLxNE0A:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: 1L32cuhtmb6D8vDRbkJJ66-3ca5cJE53 X-Proofpoint-ORIG-GUID: 1L32cuhtmb6D8vDRbkJJ66-3ca5cJE53 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-04_22,2024-11-04_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015 suspectscore=0 spamscore=0 mlxlogscore=647 malwarescore=0 priorityscore=1501 mlxscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2409260000 definitions=main-2411050007 Subject: [musl] [PATCH] mman: correct length check in __shm_mapname From: Lihua Zhao changed the length check from `p-name > NAME_MAX` to `p-name >= NAME_MAX` to correctly account for the null terminator. Signed-off-by: Lihua Zhao --- src/mman/shm_open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mman/shm_open.c b/src/mman/shm_open.c index 79784bd3..2359f067 100644 --- a/src/mman/shm_open.c +++ b/src/mman/shm_open.c @@ -15,7 +15,7 @@ char *__shm_mapname(const char *name, char *buf) errno = EINVAL; return 0; } - if (p-name > NAME_MAX) { + if (p-name >= NAME_MAX) { errno = ENAMETOOLONG; return 0; } -- 2.43.0