[Pkg-wmaker-commits] [wmtime] 02/101: wmtime: Fixed Debian bug #639626. Applied a patch by Andrew Deason.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 23:59:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmtime.
commit edc0614aaf318ccbcd2a2fff259f345b91355e53
Author: Doug Torrance <profzoom at hotmail.com>
Date: Tue Oct 30 13:49:42 2012 -0700
wmtime: Fixed Debian bug #639626. Applied a patch by Andrew Deason.
Package: wmtime
Version: 1.0b2-10
Tags: patch
wmtime draws a small amount of garbage to the screen when -noseconds is
given, because DrawTime reads beyond the given string buffer. This
doesn't trigger all the time for me (I assume due to the nondeterminism
of reading uninitialized memory or something), but it pretty clearly
happens if I switch VTs.
The attached patch limits the amount of the formatted string we try to
read, so we don't read beyond the end of the string. Fixes it for me.
--
Andrew Deason
adeason at dson.org
---
wmtime/wmtime.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/wmtime/wmtime.c b/wmtime/wmtime.c
index 2dfed0c..6f1a007 100644
--- a/wmtime/wmtime.c
+++ b/wmtime/wmtime.c
@@ -344,17 +344,20 @@ void DrawTime(int hr, int min, int sec) {
char time[time_size];
char *p = time;
int i,j,k=6;
+ int numfields;
/* 7x13 */
if (noseconds) {
snprintf(time, time_size, "%02d:%02d ", hr, min);
+ numfields = 2;
}
else {
snprintf(time, time_size, "%02d:%02d:%02d ", hr, min, sec);
+ numfields = 3;
}
- for (i=0; i < 3; i++) {
+ for (i=0; i < numfields; i++) {
for (j=0; j<2; j++) {
copyXPMArea((*p-'0')*7 + 1, 84, 8, 13, k, 18);
k += 7;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmtime.git
More information about the Pkg-wmaker-commits
mailing list