From f93fad20d476484fc7a2ea4b38a26e6f902115b4 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 27 May 2002 11:37:40 +0000 Subject: [PATCH] check location before dereference --- lib/isc/unix/file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c index 6795585fd2..db3f663dd8 100644 --- a/lib/isc/unix/file.c +++ b/lib/isc/unix/file.c @@ -48,7 +48,7 @@ * SUCH DAMAGE. */ -/* $Id: file.c,v 1.44 2002/05/22 05:57:17 marka Exp $ */ +/* $Id: file.c,v 1.45 2002/05/27 11:37:40 marka Exp $ */ #include @@ -212,7 +212,7 @@ isc_file_renameunique(const char *file, char *templet) { return (ISC_R_FAILURE); x = cp--; - while (*cp == 'X' && cp >= templet) { + while (cp >= templet && *cp == 'X') { isc_random_get(&which); *cp = alphnum[which % (sizeof(alphnum) - 1)]; x = cp--; @@ -258,7 +258,7 @@ isc_file_openunique(char *templet, FILE **fp) { return (ISC_R_FAILURE); x = cp--; - while (*cp == 'X' && cp >= templet) { + while (cp >= templet && *cp == 'X') { isc_random_get(&which); *cp = alphnum[which % (sizeof(alphnum) - 1)]; x = cp--;