Page MenuHomeFreeBSD

D58489.id182851.diff
No OneTemporary

D58489.id182851.diff

diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -868,7 +868,8 @@
{
const char *mkfilename, *clientname, *clntname, *xdrname, *hdrname;
const char *servername, *svcname, *servprogname, *clntprogname;
- char *temp, *mkftemp;
+ const char *temp;
+ char *mkftemp;
svcname = file_name(cmd->infile, "_svc.c");
clntname = file_name(cmd->infile, "_clnt.c");
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c
--- a/usr.bin/rpcgen/rpc_svcout.c
+++ b/usr.bin/rpcgen/rpc_svcout.c
@@ -31,6 +31,7 @@
* rpc_svcout.c, Server-skeleton outputter for the RPC protocol compiler
* Copyright (C) 1987, Sun Microsystems, Inc.
*/
+#include <limits.h>
#include <stdio.h>
#include <string.h>
#include "rpc_parse.h"
@@ -931,14 +932,20 @@
static void
open_log_file(const char *infile, const char *sp)
{
- char *s;
+ const char *s;
s = strrchr(infile, '.');
- if (s)
- *s = '\0';
- f_print(fout, "%sopenlog(\"%s\", LOG_PID, LOG_DAEMON);\n", sp, infile);
- if (s)
- *s = '.';
+ if (s) {
+ size_t len;
+
+ len = s - infile;
+ if (len > INT_MAX)
+ len = INT_MAX;
+ f_print(fout, "%sopenlog(\"%.*s\", LOG_PID, LOG_DAEMON);\n",
+ sp, (int)len, infile);
+ } else
+ f_print(fout, "%sopenlog(\"%s\", LOG_PID, LOG_DAEMON);\n",
+ sp, infile);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Aug 4, 7:45 AM (53 m, 9 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35917635
Default Alt Text
D58489.id182851.diff (1 KB)

Event Timeline