Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2215483/?format=api
{ "id": 2215483, "url": "http://patchwork.ozlabs.org/api/patches/2215483/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20260324172242.16403-1-marocketbd@gmail.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260324172242.16403-1-marocketbd@gmail.com>", "list_archive_url": null, "date": "2026-03-24T17:22:41", "name": "[v3] libio: Fix fmemopen_write on appending condition", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "a7408597bcd2981bb77d907d5fff51ccdbb63f9f", "submitter": { "id": 92898, "url": "http://patchwork.ozlabs.org/api/people/92898/?format=api", "name": "Rocket Ma", "email": "marocketbd@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20260324172242.16403-1-marocketbd@gmail.com/mbox/", "series": [ { "id": 497320, "url": "http://patchwork.ozlabs.org/api/series/497320/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=497320", "date": "2026-03-24T17:22:41", "name": "[v3] libio: Fix fmemopen_write on appending condition", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/497320/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2215483/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2215483/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "libc-alpha@sourceware.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "libc-alpha@sourceware.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=L+gXtdTV;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=L+gXtdTV", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=none smtp.remote-ip=2607:f8b0:4864:20::1231" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fgH271T01z1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 04:23:43 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id CDAE14B9DB65\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 24 Mar 2026 17:23:40 +0000 (GMT)", "from mail-dl1-x1231.google.com (mail-dl1-x1231.google.com\n [IPv6:2607:f8b0:4864:20::1231])\n by sourceware.org (Postfix) with ESMTPS id 387934BA903C\n for <libc-alpha@sourceware.org>; Tue, 24 Mar 2026 17:23:19 +0000 (GMT)", "by mail-dl1-x1231.google.com with SMTP id\n a92af1059eb24-12732e6a123so9275768c88.1\n for <libc-alpha@sourceware.org>; Tue, 24 Mar 2026 10:23:19 -0700 (PDT)", "from localhost ([23.94.240.252]) by smtp.gmail.com with UTF8SMTPSA\n id\n a92af1059eb24-12a734bbb57sm11729892c88.10.2026.03.24.10.23.17\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 24 Mar 2026 10:23:17 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org CDAE14B9DB65", "OpenDKIM Filter v2.11.0 sourceware.org 387934BA903C" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 387934BA903C", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 387934BA903C", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774372999; cv=none;\n b=l08tnZvGgiZPkbA5uQPvzXTPvDvA0CFncu/OuGba0hCqQOy8z4LQP+qTab06p8KNIRlpZQITwBdGXUDQBKxtXYJ5mzF3jApqOHoQ574MXZBN/jstEh0rhjXbsdxGLfialv37kZyPS3gLqUQADApCxJ5bYO5hhcw33SFNZc7el/E=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774372999; c=relaxed/simple;\n bh=ztVCP61P2Ywn1srtdeAi8ubxOaSSPCDeF9U5FACmXTM=;\n h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version;\n b=tFTavQ7CR79FW+k3y8lvULDzURFv4tos5dRNcL1xy1hGnqPuK2cmKCArjuVi7GMUGAQmvWkVB2/opeTizipMku1TQopSm2i5uZbL/YF8QZsRLWyzdC8fsVACKrpjzBHUOPVNYKhD8K+Co8Qd1Hi6GeVzEqPRNqV1Q42u/2YM0Ok=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1774372998; x=1774977798; darn=sourceware.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=uauDSW6Of36Y/02/LtNwCYd3/QhSVi7vFH7oZ+Gs74E=;\n b=L+gXtdTVnNOjhrqvmgky5bbBkcRxDXZK5ls23mahEDJxiQ2mXDnvrPPHWcBnobiT09\n s0WeqrroGODqacw++iTobTeuQpOA592Yn+x7cSCKYtkjvWNzh91oHg0yhMLVULEhUlnB\n NxymEbErMc+Mt7Po39OUZn+a95GkKPt33czROel9fbN19jRBWz8GmISmn8Nf+WmsaaD6\n A/qL9Wd5sDmc+TwzlToFwZOHsoorM/iBNr2o55Enb98S7pKHhetzr7xyqMt7E0YrLKKc\n OkFOXALibweVKHwct5wmInEcegNNax+WBF+7oBpi2LkNmFhy1Udt4IZr995mrKTSUQC5\n n3gA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774372998; x=1774977798;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=uauDSW6Of36Y/02/LtNwCYd3/QhSVi7vFH7oZ+Gs74E=;\n b=Mjab49KzMz/gfLwdfJba+oOW3qqsvMZO+fLPKhbxWwPd9hRjpQSVZPRf70iAiEyCRN\n eP/90++/MTQ6KX4/5LEWqX7TL6kZMs7iMWLMj6WvAf/BH1Z/i+wJBdla1DnjeF2wudSt\n 5jYJXotfkWyjq1Kuer07WjAiUEUMrmDmseZBO5d2lL/QaRzSy6wikelRTFF61ayJND7S\n JB9HrG950N9NaJ8HLqflBd5F7PGyI+ze8al2G8UO32/RBTpG7MzH3VUIgCGfVZaqBLjH\n eqmUcG9LxHVQEJqouB26venwkS4jXox0ipc2GZyUuRSIyOgtttZ/vJO5PyObCs/74Ra7\n uZCQ==", "X-Gm-Message-State": "AOJu0Yy2hk6ex+q5WLuMALsdNJcDzvdgosST1q7YvlSL9QumvySfTtvV\n DP325+w/Ink6dbTnVUiWXobNtmQ9o8ZypLt02ZOv0CYQCnZ/EOegP2yXxfTrow==", "X-Gm-Gg": "ATEYQzyYlsM0FOGWRixGUQYrdsI4j5pkN6BOdnDm66RyQCwDUy7g449y3GBxAbaevg/\n bPP92XD+ahA8yIos5BjjrBHuFV/klfGMw6sGh6PHJo6KkIn+qe4n8Odw8vz02v8R7n4+45idaos\n rAVgrIdNL3mD2gx8FccIg7NXcCgE+q5zUWwd9oly+b/w9rK4XAYn/LHsQvYG45FEeGYld0rOZ3U\n SqB7JTw34/xOQ87xKU0cFrLv3P/fBvtEpAgL8LIMtx/W+oy5L5qXNA9XnWXgNLZHPuUV5hlnwy1\n Ppu7eWGx/ctF9TY4I6SBDoC2ycQGBpO/VDST102nPP56ZrG/Df8P09Osix9OnVKZdxkAYA+Xh4i\n xNPgFiMkzohbAs1Nm8/BF/0twERMNd6PYQv6Hlr8GjujwT+4wfVYwuptFA1wRzkm9yvHCuYQIKB\n kBi4squkJWnNZZaO+zQeY=", "X-Received": "by 2002:a05:7022:e17:b0:12a:7181:2f1c with SMTP id\n a92af1059eb24-12a96e6b019mr148763c88.17.1774372997928;\n Tue, 24 Mar 2026 10:23:17 -0700 (PDT)", "From": "Rocket Ma <marocketbd@gmail.com>", "To": "Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>", "Cc": "libc-alpha@sourceware.org", "Subject": "[PATCH v3] libio: Fix fmemopen_write on appending condition", "Date": "Tue, 24 Mar 2026 10:22:41 -0700", "Message-ID": "<20260324172242.16403-1-marocketbd@gmail.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<cd13e348-b726-4540-af37-7f1669cad80b@linaro.org>", "References": "", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "libc-alpha@sourceware.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Libc-alpha mailing list <libc-alpha.sourceware.org>", "List-Unsubscribe": "<https://sourceware.org/mailman/options/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe>", "List-Archive": "<https://sourceware.org/pipermail/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-request@sourceware.org?subject=help>", "List-Subscribe": "<https://sourceware.org/mailman/listinfo/libc-alpha>,\n <mailto:libc-alpha-request@sourceware.org?subject=subscribe>", "Errors-To": "libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org" }, "content": "* libio/fmemopen.c: reference pos the variable instead of c->pos\n\nTo reproduce, write a C unit with the following code and then compile it\nand run it, should expect an output with \"1 No space left on device\".\nApparently, for appending mode, there is enough room to write some\nbytes, but it didn't. `c->pos` should be corrected to `pos`.\n\nSigned-off-by: Rocket Ma <marocketbd@gmail.com>\n---\n libio/Makefile | 1 +\n libio/bug-fmemopen.c | 37 +++++++++++++++++++++++++++++++++++++\n libio/fmemopen.c | 2 +-\n 3 files changed, 39 insertions(+), 1 deletion(-)\n create mode 100644 libio/bug-fmemopen.c", "diff": "diff --git a/libio/Makefile b/libio/Makefile\nindex 08e1e0ec25..c60ebf800d 100644\n--- a/libio/Makefile\n+++ b/libio/Makefile\n@@ -70,6 +70,7 @@ routines_no_fortify += \\\n # routines_no_fortify\n \n tests = \\\n+ bug-fmemopen \\\n bug-fopena+ \\\n bug-fseek \\\n bug-ftell \\\ndiff --git a/libio/bug-fmemopen.c b/libio/bug-fmemopen.c\nnew file mode 100644\nindex 0000000000..080ea5835c\n--- /dev/null\n+++ b/libio/bug-fmemopen.c\n@@ -0,0 +1,37 @@\n+/* Regression test for fmemopen bug BZ 34006\n+ Copyright (C) 2021-2023 Free Software Foundation, Inc.\n+ This file is part of the GNU C Library.\n+\n+ The GNU C Library is free software; you can redistribute it and/or\n+ modify it under the terms of the GNU Lesser General Public\n+ License as published by the Free Software Foundation; either\n+ version 2.1 of the License, or (at your option) any later version.\n+\n+ The GNU C Library is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ Lesser General Public License for more details.\n+\n+ You should have received a copy of the GNU Lesser General Public\n+ License along with the GNU C Library; if not, see\n+ <https://www.gnu.org/licenses/>. */\n+\n+#include <support/check.h>\n+#include <stdio.h>\n+\n+static int\n+do_test (void)\n+{\n+ char buf[5] = \"1\";\n+ FILE *fp = fmemopen (buf, 4, \"a+\");\n+ TEST_VERIFY (fp);\n+ TEST_VERIFY (fseek (fp, 3, SEEK_SET) == 0);\n+ setbuf (fp, NULL);\n+ TEST_VERIFY (fwrite (\"XXXX\", 1, 4, fp) > 0);\n+ TEST_COMPARE_STRING (buf, \"1XXX\");\n+ fclose (fp);\n+\n+ return 0;\n+}\n+\n+#include <support/test-driver.c>\ndiff --git a/libio/fmemopen.c b/libio/fmemopen.c\nindex f2ae1338d3..cdc3a3476e 100644\n--- a/libio/fmemopen.c\n+++ b/libio/fmemopen.c\n@@ -71,7 +71,7 @@ fmemopen_write (void *cookie, const char *b, size_t s)\n \n if (pos + s > c->size)\n {\n- if ((size_t) (c->pos + addnullc) >= c->size)\n+ if ((size_t) (pos + addnullc) >= c->size)\n \t{\n \t __set_errno (ENOSPC);\n \t return 0;\n", "prefixes": [ "v3" ] }