From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39788 invoked by alias); 10 Apr 2018 08:08:53 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 38710 invoked by uid 89); 10 Apr 2018 08:08:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,SPF_PASS autolearn=ham version=3.3.2 spammy=schwab, 0EEA, schwab@suse.de, e4d4 X-HELO: mx2.suse.de From: Andreas Schwab To: Paul Pluzhnikov Cc: GLIBC Devel Subject: Re: [patch] Fix path length overflow in realpath (BZ#22786) References: X-Yow: WHOA!! Ken and Barbie are having TOO MUCH FUN!! It must be the NEGATIVE IONS!! Date: Tue, 10 Apr 2018 08:08:00 -0000 In-Reply-To: (Paul Pluzhnikov's message of "Tue, 10 Apr 2018 00:25:21 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-04/txt/msg00185.txt.bz2 On Apr 10 2018, Paul Pluzhnikov wrote: > + const size_t path_len = (size_t) INT_MAX + 1; > + char *path = malloc (path_len); > + > + if (path == NULL) > + { > + printf ("malloc (%zu): %m\n", path_len); > + return EXIT_FAILURE; > + } Trying to allocate a block of INT_MAX+1 is rather likely to fail on a 32-bit platform. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."