Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3464159pxv; Mon, 28 Jun 2021 05:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVBi56nVN5NdIgOQe5P1eLCSwmyH4AIBw8sjZCmfG+PJaF/TpyN27X1QUFTuWqwFCnyYoY X-Received: by 2002:aa7:dc0c:: with SMTP id b12mr11218398edu.105.1624882452200; Mon, 28 Jun 2021 05:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624882452; cv=none; d=google.com; s=arc-20160816; b=x4Ha8CJeLV3FyT5XSTgfvmVGEjS3LDWJ/KAhXcIHPjt4Y3z0DTiRPwhQknmwjN4Bru NjYpDtbwnat5HVUZFKgP4maBP+wGvCfe8Rmh5oixtaCY+3mnui1bSJJZbAUm9Se0KYbL WrVO8FH07Np6HTtRFeRSVhiosPpm2RKJuRyzhuLATMU+uCOJlYxx2OFm6HX0XUDpI6oR SQdv8sDoeeYBLgZXAkSnOil8/m0xc1uXKvbJAgVH+AjzT6oNovHaFEOWKUIZMHINjb4G /QqHf+AZSICLSycj2fJUy6H28bi01LfIYDVOhNpfiIfwjlKXCItKQRpKi+6J5jo9VL9W tLjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject:dkim-signature; bh=/s5ntRR1JmxnVmTebmtMvo/S0ha2iJsjhTLPq9iWUNo=; b=nkACFz6/qMwJ1o07s3BvtT4CSxfXtLhzXGHQoq7K60KHE0ret68E8WcWYfZ0dyfZp1 5McAA8D6DdfU6TXTaYNkVCBMG6p2sf93Pl5aszXf/+NWhdykQFCTofgI6jTZ9f1S6YyX QEZMxaVC86jktryKhilf55av/glEF8dJ0RBJ9YmX+1sbicUHA9NSJoyFQVF+wmEuoo0a dGL8E8kKiurx3YQ7BxnnLKfgWa5x1DkbYG7Q033LA5FDqKC1hRk1KyelfBN2eI5mr6zE 79F7QGT1YHx/Yg9LAUh7YyM8g5T7RO2mMoD5ayBaH6opyeWQzJJCOcQhvJ3SE1LQC6lV hZbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r8DcmgKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s25si134927eds.432.2021.06.28.05.13.47; Mon, 28 Jun 2021 05:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r8DcmgKn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232862AbhF1MNI (ORCPT + 99 others); Mon, 28 Jun 2021 08:13:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbhF1MNH (ORCPT ); Mon, 28 Jun 2021 08:13:07 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C795C061574 for ; Mon, 28 Jun 2021 05:10:42 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso13581751wmh.4 for ; Mon, 28 Jun 2021 05:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/s5ntRR1JmxnVmTebmtMvo/S0ha2iJsjhTLPq9iWUNo=; b=r8DcmgKnJzDsSe9H9XdHRMx+qFTw3ab7ZUGEi94m8rfq2F5rg2c3b66zKeWc47rsv+ JXd54tjxiqLkS9ohZddHT2jh4w8bexyyZygC3N5k/EWMhLA3bafolhAO3nook56HshOO Yi1knHs/uDdKJCblnujaNy+A2FKiAU2HOp4u8NJyR73sYUdOkgof9wm4kI52ASzszIMq BgRNtuxIqpkS/WQ2/+LImWHrNB1AYq0nmfPmUZZSi2GH9XUdpJcoEEtzy8YIlZn1uZ3V 22oNnxICMAA/HAbsCgfU7gVpvob6AebRLP5qib+NOaraQ3V8o5fgcmrzPGGj8ThS2da4 4X3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/s5ntRR1JmxnVmTebmtMvo/S0ha2iJsjhTLPq9iWUNo=; b=rr/jGi4ZHlusKyu9b8GHzBV9xWA/rgEtCcUos1MTU8XvfQUs+Gr4xbywdn3wet15NN fMYarulP4Ge5C7JmiO7y+fUGaJkCc5io90QtmVuDEiHVzq9FT6+q8FxkBF1C9wbuzqC/ ffJWqgYL4Uzd5mdHEYiny9krWD1s91QvgTSTl1NJUJg/tnW0MCX1KzLdbzGOsVlj2de8 f/xNTBZRv2QGzJm1ITiCz+KDiWnqXWyKsOnS0j9YnQ1j+YIer8oQz0k3Yu+oOIjijojP mUGzHraHZF33Wapdtq8/9w2TWY+eNs6m1ycGIRoFLZ9anor5Ak3pi36S1/IuQa+HLr4v 4rVg== X-Gm-Message-State: AOAM531DrDkS8CFdJSDNAFvNOmNr20poRsSjrNJVvjS/hjNi6Tm0ENx+ im28wYtX33hREfP/S1cBK/g= X-Received: by 2002:a05:600c:2cb5:: with SMTP id h21mr1646938wmc.91.1624882240885; Mon, 28 Jun 2021 05:10:40 -0700 (PDT) Received: from [10.8.0.150] ([195.53.121.100]) by smtp.gmail.com with ESMTPSA id c133sm19076433wmf.0.2021.06.28.05.10.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 28 Jun 2021 05:10:40 -0700 (PDT) Subject: Re: [RFC] strcpys(): New function for copying strings safely From: "Alejandro Colomar (man-pages)" To: David Laight , glibc Cc: "tech@openbsd.org" , Christoph Hellwig , "linux-kernel@vger.kernel.org" , drepper@gmail.com References: <755875ec-baae-6cab-52a8-3c9530db1ce6@gmail.com> <38428d5e-ead2-bf18-e198-cecd4caeb3e7@gmail.com> <52e57bd5-0d04-4b4f-978a-8c1dbc08115c@gmail.com> Message-ID: <6ea2efaf-7898-9723-54e7-2cd59702f854@gmail.com> Date: Mon, 28 Jun 2021 14:10:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/28/21 2:00 PM, Alejandro Colomar (man-pages) wrote: > l = strscat(n - l, dest + l, src2); Hmm, that's a bug; I wrote it too fast. Either l += strscpy(n - l, dest + l, src2); or l = strscat(n - l, dest, src2); should be used instead. -- Alejandro Colomar Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/ http://www.alejandro-colomar.es/