Date: Tue, 3 Jul 2001 02:20:07 -0400 (EDT) From: Mike Barcroft <mike@q9media.com> To: Mike Heffner <mheffner@novacoxmail.com> Cc: audit@FreeBSD.org, Mike Heffner <mheffner@vt.edu> Subject: Re: src/bin/chio patch Message-ID: <200107030620.f636K7u06516@coffee.q9media.com>
next in thread | raw e-mail | index | archive | help
Mike Barcroft <mike@q9media.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200107030620.f636K7u06516>