From owner-freebsd-current@freebsd.org Sat Dec 31 14:15:02 2016 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CBA8C9935F for ; Sat, 31 Dec 2016 14:15:02 +0000 (UTC) (envelope-from imb@protected-networks.net) Received: from mail.protected-networks.net (mail.protected-networks.net [IPv6:2001:470:8d59:1::8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protected-networks.net", Issuer "Protected Networks CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 502E21987; Sat, 31 Dec 2016 14:15:02 +0000 (UTC) (envelope-from imb@protected-networks.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= protected-networks.net; h=content-transfer-encoding:content-type :content-type:mime-version:user-agent:date:date:message-id :subject:subject:from:from; s=201508; t=1483193692; bh=npIZf9n9B ercANUOThnb5Xn+JJi/BZVXONN0ucswc6Y=; b=kuqWR8YXzzI/UKTOMsfIHhX9u LyVaa1/jFzf64W145EzQrh6Ojx/ebQRVfId6SKeaiyLEGNgPiTIMnj4nNJZBlms7 XNczmVbGC554xN+R+UlxJwQFv29DoWa0URFFLMO8nNidU3ioaUNi0M8m1FkH6nJi gEvdIRyBNHSZCcWN9Y= Received: from toshi.auburn.protected-networks.net (toshi.auburn.protected-networks.net [192.168.1.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: imb@mail.protected-networks.net) by mail.protected-networks.net (Postfix) with ESMTPSA id E4496EFE2; Sat, 31 Dec 2016 09:14:52 -0500 (EST) To: ngie@freebsd.org, freebsd-current From: Michael Butler Subject: SVN r310931 Bad code Openpgp: id=6F63E6399DCC8E3E94D60F0642FF6BAE0442D492 Message-ID: <742de824-6f35-8c91-8603-c5a766e313b4@protected-networks.net> Date: Sat, 31 Dec 2016 09:14:52 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Dec 2016 14:15:02 -0000 At line 1949 of head/contrib/bsnmp/lib/snmpclient.c, you changed .. - if ((sc->chost = malloc(strlen(s) + 1)) == NULL) { + if ((sc->chost = strdup(strlen(s))) == NULL) { This can't work as intended since strlen returns the length of the string not a pointer to it. I expect this should be .. if ((sc->chost = strdup(s)) == NULL) { Michael