From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21780 invoked from network); 18 Dec 2020 10:24:56 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 18 Dec 2020 10:24:56 -0000 Received: from mail-vs1-f53.google.com ([209.85.217.53]) by ewsd; Fri Dec 18 05:21:35 -0500 2020 Received: by mail-vs1-f53.google.com with SMTP id u7so1057984vsg.11 for <9front@9front.org>; Fri, 18 Dec 2020 02:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=awbD5CO2Zxxa+L2wfZukwIuxRT9Fs9fR6ObrEfuLMz0=; b=KK+CWHbYIP4aBSN6M+y5Y9rDYysJ2tUmriQUuG0LLyNrkH5kK3WgH0puljjbIWdreo s+0MaUP234/Kyq34iLO0WxfHP9vv6Rk1YLOZFTUFutvNQy5QCH9gprggEkoou6ZxRSSB l7uUDA35rL76HbO5tuVG3zm+NNye2ktClZbG5GobBEXZ1xnmt4EXxc2GQ7psmOMvXd6Y DIBE1vaS7hTHjK5i9ouFltHEX919CHHrDoBfWI23NxSvQf9kW1b9GVXgo4SXuKc/7QGT pXIi2weRN9eiXdn0WskT24KZQEhyG8HpHQoJAkMA/K1951QjBdr/CqOniCR9YBGtf8pJ 4qWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=awbD5CO2Zxxa+L2wfZukwIuxRT9Fs9fR6ObrEfuLMz0=; b=X7F1s9wXQY+mC9yB87fhjB8s8SuRt6w7vN6LIz4LqrykG4NtTBzgyxFmUOLov6bpem kOT5Swg7FPJHIUzZ0k4S+xnVgITIUm04XnCliIq0aiOjZz0mLE5f/ibkV75qfRtJElF1 oG9TldrNz/CJzEshtDKBdYEXGg6csngOhx3mZeUmXM5D+Ifs7jhHnREzZglVFpjRXIfx j9f/Jm6HgxPI3N9I8wMQfTH2w0CXIIyWEU//8V4QaEUk2BCg5hNnGHa9n94v6eDDP/J0 V9Heuya+oBqQjThVKLAXlgdc+HgPnxg61rXeYCr/vOBNg9hKVFL0luRqxT13YM/H4tIj 30Zg== X-Gm-Message-State: AOAM5317GuwLK7h85P0/TXFbJEouQ+ee7Tx8gnfOeSdpBer984r6ePnL CdIR8C0o7AzMKL27QixyB48D8Qf6+oRYYnZkYbRIkV75i8eRmK3g X-Google-Smtp-Source: ABdhPJxW4JaeyaAc0RvThBaP9D+a83iady/nYbxSX5nuxJIv75eKO9Y22nSNO7ka+/fcpYeW4ukDbnCce1z3RcOSc4c= X-Received: by 2002:a67:fb87:: with SMTP id n7mr2862267vsr.23.1608286886635; Fri, 18 Dec 2020 02:21:26 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a67:e319:0:0:0:0:0 with HTTP; Fri, 18 Dec 2020 02:21:26 -0800 (PST) In-Reply-To: References: <20201218090144.GB742@polynum.com> From: Kemal Date: Fri, 18 Dec 2020 13:21:26 +0300 Message-ID: To: 9front@9front.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: optimized information markup-aware template-aware element manager Subject: Re: [9front] strndup should use strnlen and memcpy Reply-To: 9front@9front.org Precedence: bulk 2020-12-18 12:59 GMT+03:00, Sigrid Solveig Hafl=C3=ADnud=C3=B3ttir : >> Because the terminating '\0' may not be here. > > Why wouldn't it be there? Isn't strndup supposed to work on strings? > Is there any (trustworthy standard-like) source that mentions > non-terminated strings as something that should work with strndup? > > Open Group does not specify if arg1 should be null terminated or not. https://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html