=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/entries.c,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** src/usr.bin/cvs/entries.c 2005/02/22 16:09:28 1.25 --- src/usr.bin/cvs/entries.c 2005/04/15 14:34:15 1.26 *************** *** 1,4 **** ! /* $OpenBSD: entries.c,v 1.25 2005/02/22 16:09:28 jfb Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. --- 1,4 ---- ! /* $OpenBSD: entries.c,v 1.26 2005/04/15 14:34:15 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau * All rights reserved. *************** *** 27,37 **** #include #include ! #include #include #include - #include #include #include "log.h" #include "cvs.h" --- 27,38 ---- #include #include ! #include #include + #include #include #include + #include #include "log.h" #include "cvs.h" *************** *** 52,58 **** cvs_ent_open(const char *dir, int flags) { size_t len; ! int exists; char entpath[MAXPATHLEN], ebuf[128], mode[4]; FILE *fp; struct stat st; --- 53,59 ---- cvs_ent_open(const char *dir, int flags) { size_t len; ! int exists, l; char entpath[MAXPATHLEN], ebuf[128], mode[4]; FILE *fp; struct stat st; *************** *** 62,68 **** exists = 0; memset(mode, 0, sizeof(mode)); ! snprintf(entpath, sizeof(entpath), "%s/" CVS_PATH_ENTRIES, dir); switch (flags & O_ACCMODE) { case O_WRONLY: --- 63,74 ---- exists = 0; memset(mode, 0, sizeof(mode)); ! l = snprintf(entpath, sizeof(entpath), "%s/" CVS_PATH_ENTRIES, dir); ! if (l == -1 || l >= (int)sizeof(entpath)) { ! errno = ENAMETOOLONG; ! cvs_log(LP_ERRNO, "%s", entpath); ! return (NULL); ! } switch (flags & O_ACCMODE) { case O_WRONLY: