From owner-cvs-all Thu Aug 30 12:58: 9 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 8F34437B406; Thu, 30 Aug 2001 12:58:00 -0700 (PDT) (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7UJs4p40077; Thu, 30 Aug 2001 12:54:04 -0700 (PDT) (envelope-from ache) Message-Id: <200108301954.f7UJs4p40077@freefall.freebsd.org> From: "Andrey A. Chernov" Date: Thu, 30 Aug 2001 12:54:04 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/libc/stdio fseek.c ftell.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ache 2001/08/30 12:54:04 PDT Modified files: lib/libc/stdio fseek.c ftell.c Log: Add more EOVERFLOW checks. When file offset tends to be negative due to internal and ungetc buffers additions counted, try to discard some ungetc data first, then return EBADF. Later one can happens if lseek(fileno(fd),...) called f.e. POSIX says that ungetc beyond beginning of the file results are undefined, so we can just discard some of ungetc data in that case. Don't rely on gcc cast when checking for overflow, use OFF_MAX. Cosmetique. Revision Changes Path 1.20 +62 -25 src/lib/libc/stdio/fseek.c 1.13 +34 -8 src/lib/libc/stdio/ftell.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message