From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 111158 invoked by alias); 28 Aug 2017 12:34:59 -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 111146 invoked by uid 89); 28 Aug 2017 12:34:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=1970, 0196 X-HELO: mx1.suse.de From: Andreas Schwab To: Christian Brauner Cc: libc-alpha@sourceware.org, stgraber@stgraber.org, serge@hallyn.com, fweimer@redhat.com, joseph@codesourcery.com Subject: Re: [PATCH 2/2 v2] openpty: use TIOCGPTPEER to open slave side fd References: <3496d984-a55e-d56b-2c25-a23200327dca@redhat.com> <20170828121106.2629-1-christian.brauner@ubuntu.com> X-Yow: If I pull this SWITCH I'll be RITA HAYWORTH!! Or a SCIENTOLOGIST! Date: Mon, 28 Aug 2017 12:34:00 -0000 In-Reply-To: <20170828121106.2629-1-christian.brauner@ubuntu.com> (Christian Brauner's message of "Mon, 28 Aug 2017 14:11:06 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2017-08/txt/msg01192.txt.bz2 On Aug 28 2017, Christian Brauner wrote: > diff --git a/login/openpty.c b/login/openpty.c > index 8fbc66a3ef..43b34d7a9c 100644 > --- a/login/openpty.c > +++ b/login/openpty.c > @@ -87,9 +87,9 @@ openpty (int *amaster, int *aslave, char *name, > const struct termios *termp, const struct winsize *winp) > { > #ifdef PATH_MAX > - char _buf[PATH_MAX]; > + char _buf[PATH_MAX] = {0}; > #else > - char _buf[512]; > + char _buf[512] = {0}; > #endif No need to clear the whole array, just the first byte. 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."