From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S270342AbTHLOIJ (ORCPT ); Tue, 12 Aug 2003 10:08:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S270352AbTHLOIJ (ORCPT ); Tue, 12 Aug 2003 10:08:09 -0400 Received: from i238006.ppp.asahi-net.or.jp ([61.125.238.6]:4082 "EHLO mitou.y-sato.ddo.jp") by vger.kernel.org with ESMTP id S270342AbTHLOIF (ORCPT ); Tue, 12 Aug 2003 10:08:05 -0400 Date: Tue, 12 Aug 2003 23:07:59 +0900 Message-ID: From: Yoshinori Sato To: linux kernel Mailing List Subject: generic strncpy - off-by-one error User-Agent: Wanderlust/2.11.3 (Wonderwall) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.5 - "Awara-Onsen") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org zero fill count is off-by-one error --- lib/string.c~ 2003-08-09 20:30:36.000000000 +0900 +++ lib/string.c 2003-08-12 22:55:47.000000000 +0900 @@ -89,7 +89,8 @@ while (count && (*dest++ = *src++) != '\0') count--; - while (count) { + count--; + while (count > 0) { *dest++ = 0; count--; } -- Yoshinori Sato