From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 11:50:52 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5E0016A4BF for ; Thu, 28 Aug 2003 11:50:52 -0700 (PDT) Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CE9343F3F for ; Thu, 28 Aug 2003 11:50:51 -0700 (PDT) (envelope-from Alexander@Leidinger.net) Received: from fwd01.aul.t-online.de by mailout05.sul.t-online.com with smtp id 19sRr5-00038b-01; Thu, 28 Aug 2003 20:50:47 +0200 Received: from Andro-Beta.Leidinger.net (XKAG1TZ-QepDqDuMpQNDRKniyNIpWD83nlBtP8yXr3NN3sp+SKG4sM@[80.131.110.239]) by fmrl01.sul.t-online.com with esmtp id 19sRqy-0zOa1Y0; Thu, 28 Aug 2003 20:50:40 +0200 Received: from Magelan.Leidinger.net (Magelan [192.168.1.1]) h7SIpg9O091088; Thu, 28 Aug 2003 20:51:42 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Received: from Magelan.Leidinger.net (netchild@localhost [127.0.0.1]) by Magelan.Leidinger.net (8.12.9/8.12.9) with SMTP id h7SIqKiK095277; Thu, 28 Aug 2003 20:52:20 +0200 (CEST) (envelope-from Alexander@Leidinger.net) Date: Thu, 28 Aug 2003 20:52:19 +0200 From: Alexander Leidinger To: Joshua Oreman Message-Id: <20030828205219.53250ddf.Alexander@Leidinger.net> In-Reply-To: <20030827153343.GA27037@webserver> References: <20030817130114.2bfb3cf1.Alexander@Leidinger.net> <20030817133824.GA71246@madman.celabo.org> <20030818115928.20c1c570.Alexander@Leidinger.net> <20030827081036.GL47959@garage.freebsd.pl> <20030827111733.23d7bb71.Alexander@Leidinger.net> <20030827153343.GA27037@webserver> X-Mailer: Sylpheed version 0.9.3claws (GTK+ 1.2.10; i386-portbld-freebsd5.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Seen: false X-ID: XKAG1TZ-QepDqDuMpQNDRKniyNIpWD83nlBtP8yXr3NN3sp+SKG4sM@t-dialin.net cc: questions@freebsd.org Subject: Re: SecFix for databases/firebird, please review X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2003 18:50:52 -0000 On Wed, 27 Aug 2003 08:33:43 -0700 Joshua Oreman wrote: > > > You also still don't add: > > > > > > buf[sizeof(buf) - 1] = '\0'; > > > > > > after all strncat(3)s. > > > > Hmmm... yes, I see the problem... > > >From strncat(3): > char* strncat (char * restrict s, const char * restrict append, size_t count); > [ ... ] > The strncat function appends not more than count characters from > append, and then adds a terminating `\0'. > (emphasis added) ^^^^^^^^^^^^^^^^^^^^^^^ > > So here there really isn't a problem. Are you sure? Lets see (pseudocode): target[100]="abcde"; source="123456"; strncat(target, source, 5); What's the result (just by looking at the man-page): - abcde12345 - abcde12345\0 - abcde1234\0 Now, write a program which verifies your assumption. Bye, Alexander. -- The best things in life are free, but the expensive ones are still worth a look. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = C518 BC70 E67F 143F BE91 3365 79E2 9C60 B006 3FE7