From 709e93ded0000128625a23838756a408ea30745d Mon Sep 17 00:00:00 2001 From: Lee Howard Date: Mon, 6 Dec 2010 16:54:54 +0000 Subject: [PATCH] Fix mode check before opening a file. http://bugzilla.maptools.org/show_bug.cgi?id=1906 --- libtiff/tif_open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtiff/tif_open.c b/libtiff/tif_open.c index 3c588eed..8c88328c 100644 --- a/libtiff/tif_open.c +++ b/libtiff/tif_open.c @@ -1,4 +1,4 @@ -/* $Id: tif_open.c,v 1.45 2010-04-02 19:26:22 fwarmerdam Exp $ */ +/* $Id: tif_open.c,v 1.46 2010-12-06 16:54:54 faxguy Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -268,7 +268,7 @@ TIFFClientOpen( /* * Read in TIFF header. */ - if (tif->tif_mode & O_TRUNC || + if ((m & O_TRUNC) || !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) { if (tif->tif_mode == O_RDONLY) { TIFFErrorExt(tif->tif_clientdata, name,