Subversion Repositories ssvnc

Compare Revisions

Ignore whitespace Rev 33 → Rev 34

/ssvnc/trunk/debian/changelog
14,8 → 14,9
CDEBUGFLAGS and LOCAL_LDFLAGS to vnc_unixsrc/*/Makefile. This results
in -fno-strict-aliasing (added by xmkmf by default) being dropped, but
that doesn't seem to cause any problems.
* format-security.patch: Fix some flaws uncovered by -Wformat-security.
 
-- Magnus Holmgren <holmgren@debian.org> Thu, 10 Nov 2011 21:54:02 +0100
-- Magnus Holmgren <holmgren@debian.org> Thu, 10 Nov 2011 22:10:59 +0100
 
ssvnc (1.0.28-1) unstable; urgency=low
 
/ssvnc/trunk/debian/patches/series
2,3 → 2,4
ultraftp_path.patch
buildflags.patch
nostrip.patch
format-security.patch
/ssvnc/trunk/debian/patches/format-security.patch
0,0 → 1,96
Author: Magnus Holmgren <holmgren@debian.org>
Description: Fix format-security warnings/errors
Replaces fprintf(stderr, str) with fputs(str, stderr) (where str in
most cases is argv[0]) and also one instance of sprintf (without
format string) with snprintf (with format string).
 
--- a/vnc_unixsrc/vncviewer/sockets.c
+++ b/vnc_unixsrc/vncviewer/sockets.c
@@ -482,7 +482,7 @@ fprintf(stderr, "R0: %06d\n", (int) dn);
ProcessXtEvents();
i = 0;
} else {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": read");
return False;
}
@@ -514,7 +514,7 @@ fprintf(stderr, "R1: %06d %06d %10.2f KB
ProcessXtEvents();
i = 0;
} else {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": read");
return False;
}
@@ -569,13 +569,13 @@ WriteExact(int sock, char *buf, int n)
FD_SET(rfbsock,&fds);
if (select(rfbsock+1, NULL, &fds, NULL, NULL) <= 0) {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": select");
return False;
}
j = 0;
} else {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": write");
return False;
}
@@ -608,13 +608,13 @@ ConnectToUnixSocket(char *file) {
sock = socket(AF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": ConnectToUnixSocket: socket");
return -1;
}
if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
- fprintf(stderr, programName);
+ fputs(programName,stderr);
perror(": ConnectToUnixSocket: connect");
close(sock);
return -1;
@@ -880,7 +880,7 @@ FindFreeTcpPort(void)
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0) {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": FindFreeTcpPort: socket");
return 0;
}
@@ -1084,7 +1084,7 @@ Bool
SetNonBlocking(int sock)
{
if (fcntl(sock, F_SETFL, O_NONBLOCK) < 0) {
- fprintf(stderr,programName);
+ fputs(programName,stderr);
perror(": AcceptTcpConnection: fcntl");
return False;
}
--- a/vnc_unixsrc/vncviewer/vncviewer.c
+++ b/vnc_unixsrc/vncviewer/vncviewer.c
@@ -130,7 +130,7 @@ void unixpw(char *instr, int vencrypt_pl
if (strlen(u) >= 100) {
exit(1);
}
- sprintf(username, u);
+ snprintf(username, sizeof(username), "%s", u);
p = DoPasswordDialog();
} else {
raiseme(1);
@@ -1133,7 +1133,7 @@ void printChat(char *str, Bool raise) {
if (raise) {
raiseme(0);
}
- fprintf(stderr, str);
+ fputs(str, stderr);
} else {
if (raise) {
ShowChat(0, 0, 0, 0);