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.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 23007 invoked from network); 18 Dec 2020 10:35:24 -0000 Received: from ewsd.inri.net (107.191.116.128) by inbox.vuxu.org with ESMTPUTF8; 18 Dec 2020 10:35:24 -0000 Received: from mail-lf1-f47.google.com ([209.85.167.47]) by ewsd; Fri Dec 18 05:31:36 -0500 2020 Received: by mail-lf1-f47.google.com with SMTP id 23so4103928lfg.10 for <9front@9front.org>; Fri, 18 Dec 2020 02:31:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:to:subject:from:date:in-reply-to:mime-version :content-transfer-encoding; bh=qR8QEXuD1QeuWMzdfagRDHPcSPZ+0YBTADTqIN/oF/0=; b=ODh0Zqd/MUKeMS7KafRqIOR0hEG361WWFxo2JH8QSk+q6DeLxreIhqFJWlxcFX4Wau JxyYfoU6OrU8hhoNyJ6rF8CxIvtRtsieN1na1uC/FTlkqq6BvFMdyeCVAg3W3WXS8Pj+ 4vNv8pjs7m0fYNftdQbGoSUiapuaMI31iTtOZ7xlykzApM7a6h5gNjbfOtM0ywkBqORm H/ESIXO7v9JjSm4xr5xkc7puoDmVPIamLcnm9usnmhDppzARWeQ8FFNsVHlR6PVlsM2V psm54Mq5102OlvuYEaNdifUSlFby7mxdjGqO3wXPG+++N2B5jvHnSYgydL709eDA0WkR vInw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:to:subject:from:date:in-reply-to :mime-version:content-transfer-encoding; bh=qR8QEXuD1QeuWMzdfagRDHPcSPZ+0YBTADTqIN/oF/0=; b=inp0WQFqzSJvrS/epXc+h+tKfOq9mDg7ExlAv2BbPZGRGSDv0vHN5d4iX//HzAQsku 6qw5A0qmtkCwUbvBx3EzfEr2Z9mKysbYfF//xWzlQe01lrog/mMWPnKO4vTNnQOfegEU 98IA3H7DHJUVegkHtxfbCBdiFb4bJxPF4I/KqWUa7Q9GqatCif8HTacY2lZmgH4HNked rwac/sQ+u6lwUr24zW+uDmKvwYsfZsOyTG6O0XbvJHu7sizyEK3Fk8wzFTyy+ZFLnkQh Va4R1O+B0IhF+xWRR7DaQHL3dN/zYolOpQQvHPryhoBYT+SwjWTQ4QIYtoYk++hASOOG oVHw== X-Gm-Message-State: AOAM533UsivC3K7uBkpIiOIfgqbm6pn0wHPtRu7xf3v5nHHXX2q5wYfR xdORdSEorZ+pgwiTc7MNm1E= X-Google-Smtp-Source: ABdhPJxko65oS9tCXcky1LATkMKGNfo6OvPb3lm6BBVsAfJE294zf+W0nDLzJ7yg4EKJsrxBFHXE/g== X-Received: by 2002:a05:6512:3321:: with SMTP id l1mr1168610lfe.473.1608287487017; Fri, 18 Dec 2020 02:31:27 -0800 (PST) Return-Path: Received: from localhost (c-adc9e655.027-406-73746f40.bbcust.telenor.se. [85.230.201.173]) by smtp.gmail.com with ESMTPSA id i19sm880945lfj.212.2020.12.18.02.31.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Dec 2020 02:31:26 -0800 (PST) Message-ID: <54874114B98195307A5780FB707F9115@gmail.com> To: kemalinanc8@gmail.com, 9front@9front.org From: "Sigrid Solveig Haflínudóttir" Date: Fri, 18 Dec 2020 11:31:22 +0100 In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: open-source ISO-certified reduce/map-aware deep-learning plugin Subject: Re: [9front] strndup should use strnlen and memcpy Reply-To: 9front@9front.org Precedence: bulk > Open Group does not specify if arg1 should be null terminated or not. > https://pubs.opengroup.org/onlinepubs/9699919799/functions/strdup.html "Applications should not assume that strndup() will allocate ( size + 1) bytes when strlen(s) is smaller than size." Pretty sure this means it's supposed to be null-terminated, or otherwise it wouldn't mention the "dangerous" strlen right there.