From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by sourceware.org (Postfix) with ESMTPS id 54D23385840D for ; Wed, 24 Apr 2024 01:39:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54D23385840D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 54D23385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1030 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713922751; cv=none; b=OqRA5Yoalqb0k10zsc64MtOOzkLz+nBOQdDk9T/RC5CyPiHdi4bUCWhdiIjMsuUai7A35KaAzz6UVF5xIa0VEImXNJMzxXWzXp8q1kl6zPEqf1B04fVOWCOiig+5arPZCWRkTugClAD8aTMNcVqDm189DKoy1FkzswXvJPU5K2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713922751; c=relaxed/simple; bh=tPX2pq0whj1cltWzEnHM1+x5D/KNActhhjL0dqZlUkE=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=GyW3E3T9HkOk6KRu0b8xCBtPJM4skH9kzUHzb1yAK0JygDB2H471T1puD5AhJ2NZu9oaxXb9jII9kQla3BjrnH1utij0dX4ua28H9KPiLc5+JJqcUDNHo+1U75ZEDCXCKpIca9ujRq2HXaGLqo0u5JlhsbYGkECUY2qGQ4aUSFY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2ad8919ba0cso2723150a91.0 for ; Tue, 23 Apr 2024 18:39:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713922744; x=1714527544; darn=sourceware.org; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=YJxFzkLcs0x6ORfI1VGisNjtlH81iGTy0+VoLkRKrys=; b=O9/EXfRcxB1yshRDiRzZFSHrS22hr5UUCGChr8qStOPiiqyulJka1rD993pQ8SaD4y uBm80RxCcvwabt7rcAYbRct+wMsXbLI7RqQYzjFSyNHMEIpdXdioqMvODNflQVuxpzfa S11hBp1oO5DgqZL1p4EqThRNooFKP4D0hCtpZBg3RZwt40yoKbeFilbXIwnmgLEwM1Tt uaiuCeFP9zE4KljqlQZjjrTD5xWvo4EKiRZELYxQ35cz8zl/fvsLONATI59dtpaO2iO9 zxQ3mqY4ZiLhl+9W7zweTbmhhF4+8vPGQee1dH0QyN9bVSp+kfqED2Oy08Infe3VhVOX PSBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713922744; x=1714527544; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=YJxFzkLcs0x6ORfI1VGisNjtlH81iGTy0+VoLkRKrys=; b=TVEvZ2Xkbn7xR76KH10YPR6dS7NpkLHVnOtjNB/RfHGAgQq8x5SDtimpH0zk1dCHoi S5rtdKnHBTZgz3PDY3KG23mnAQGtwZUtH2Ipxg2OZUMDJdTBf0QPsQ8D6BooHAyYRgvE R38JRIIDqMU9/48Gx/f4OgAWeGaitrHhRml0hTmbqn9nYiE5hPC5KW+AKaJd6g3aDcfS GhdI2ABXPLsxVHXQN+BeudNV345N+Se+X93szWNKdgje3wkqx7x20D/X6K01hdY9p7KJ zgJTcUGKGxzr/JI5+u63JQ+7OVCJBjvhqUIvpXWJckaqR6+0xoqXhLUsFh8gzaoT8Hu4 KyKg== X-Gm-Message-State: AOJu0YwXBzXw2/vhV73IKmRfrBASGuk9P761cyl3+zJSsDWb+bdW1ZvP 3PXruznZ7glikJtORh/5RU2yOWSbTPV/Kuzc5R5fJS0y3KYm9bEvaUHpkg== X-Google-Smtp-Source: AGHT+IGwkGetSfrQ4JupCzFqQQwifvod///tx94MYoN90yPc4ykzyn3107eTOq2S6Q2Z2vJA3/nPIw== X-Received: by 2002:a17:90b:4f90:b0:2aa:9738:ad2f with SMTP id qe16-20020a17090b4f9000b002aa9738ad2fmr994022pjb.6.1713922743751; Tue, 23 Apr 2024 18:39:03 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:eb45:a51c:b4d6:3d26]) by smtp.gmail.com with ESMTPSA id e13-20020a17090ab38d00b0029c49ed3974sm10092969pjr.37.2024.04.23.18.39.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 18:39:03 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 37552114015E; Wed, 24 Apr 2024 11:09:00 +0930 (ACST) Date: Wed, 24 Apr 2024 11:09:00 +0930 From: Alan Modra To: binutils@sourceware.org Subject: buffer overflow in libctf tests Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3033.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * testsuite/libctf-regression/gzrewrite.c (main): Don't overflow "a" buffer in "after adding types" check. * testsuite/libctf-regression/zrewrite.c (main): Likewise. diff --git a/libctf/testsuite/libctf-regression/gzrewrite.c b/libctf/testsuite/libctf-regression/gzrewrite.c index 99722200950..2e679e85bfe 100644 --- a/libctf/testsuite/libctf-regression/gzrewrite.c +++ b/libctf/testsuite/libctf-regression/gzrewrite.c @@ -114,7 +114,7 @@ main (int argc, char *argv[]) if ((b = read_gz ("tmpdir/two.gz", &b_len)) == NULL) goto read_err; - if (memcmp (a, b, b_len) == 0) + if (a_len == b_len && memcmp (a, b, b_len) == 0) { fprintf (stderr, "gzwrites after adding types does not change the dict\n"); return 1; diff --git a/libctf/testsuite/libctf-regression/zrewrite.c b/libctf/testsuite/libctf-regression/zrewrite.c index a88c824b568..5e061f10a5f 100644 --- a/libctf/testsuite/libctf-regression/zrewrite.c +++ b/libctf/testsuite/libctf-regression/zrewrite.c @@ -109,7 +109,7 @@ main (int argc, char *argv[]) b = read_file ("tmpdir/two", &b_len); - if (memcmp (a, b, b_len) == 0) + if (a_len == b_len && memcmp (a, b, b_len) == 0) { fprintf (stderr, "compress_writes after adding types does not change the dict\n"); return 1; -- Alan Modra Australia Development Lab, IBM