From owner-freebsd-audit Mon Jul 2 23: 5:58 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id 336A837B406 for ; Mon, 2 Jul 2001 23:05:56 -0700 (PDT) (envelope-from mike@coffee.q9media.com) Received: (from mike@localhost) by coffee.q9media.com (8.11.2/8.11.2) id f636K7u06516; Tue, 3 Jul 2001 02:20:07 -0400 (EDT) (envelope-from mike) Date: Tue, 3 Jul 2001 02:20:07 -0400 (EDT) Message-Id: <200107030620.f636K7u06516@coffee.q9media.com> To: Mike Heffner From: Mike Barcroft Cc: audit@FreeBSD.org, Mike Heffner Subject: Re: src/bin/chio patch Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Barcroft writes: > - strncpy(csvr.csvr_voltag.cv_volid, argv[2], > + (void) memcpy(csvr.csvr_voltag.cv_volid, argv[2], > sizeof(csvr.csvr_voltag.cv_volid)); > + csvr.csvr_voltag.cv_volid[strlen(argv[2]) + 1] = '\0'; Hmm.. what was I thinking with this? It's probably better just to use a cast. Also the NUL char is off by one byte and assumes that strlen(argv[2]) < sizeof(csvr.csvr_voltag.cv_volid). I should go to sleep. I'll fix this in the morning. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message