summaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2009-05-23 15:14:45 +0200
committerTobias Klauser <tklauser@distanz.ch>2009-05-23 15:14:45 +0200
commite016103fa25167594b9ff5d410019f114b7a36fb (patch)
tree0fd8b5b9c824f3611c24ed00dcbc2058579e15a1 /src/edit.c
parent04b38c4c173cef3b1b12163f1cf5a9b3cef8cb4a (diff)
New upstream release 15.7a, fixing CVE-2009-014815-7a-1
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c
index 5d97949..0f4edec 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -42,7 +42,7 @@
#include <curses.h>
#endif
-static char const rcsid[] = "$Id: edit.c,v 1.6 2006/08/20 15:00:34 broeker Exp $";
+static char const rcsid[] = "$Id: edit.c,v 1.7 2009/04/10 13:39:23 broeker Exp $";
/* edit this displayed reference */
@@ -105,9 +105,9 @@ edit(char *file, char *linenum)
char *s;
file = filepath(file);
- (void) sprintf(msg, "%s +%s %s", mybasename(editor), linenum, file);
+ (void) snprintf(msg, sizeof(msg), "%s +%s %s", mybasename(editor), linenum, file);
postmsg(msg);
- (void) sprintf(plusnum, lineflag, linenum);
+ (void) snprintf(plusnum, sizeof(plusnum), lineflag, linenum);
/* if this is the more or page commands */
if (strcmp(s = mybasename(editor), "more") == 0 || strcmp(s, "page") == 0) {
@@ -132,7 +132,7 @@ filepath(char *file)
static char path[PATHLEN + 1];
if (prependpath != NULL && *file != '/') {
- (void) sprintf(path, "%s/%s", prependpath, file);
+ (void) snprintf(path, sizeof(path), "%s/%s", prependpath, file);
file = path;
}
return(file);