mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
check location before dereference
This commit is contained in:
parent
5fdea8467e
commit
f93fad20d4
1 changed files with 3 additions and 3 deletions
|
|
@ -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 <config.h>
|
||||
|
||||
|
|
@ -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--;
|
||||
|
|
|
|||
Loading…
Reference in a new issue