File: 141_buffer_overflow.diff

package info (click to toggle)
predict 2.2.3-4
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,712 kB
  • ctags: 1,623
  • sloc: ansic: 19,433; sh: 3,518; makefile: 429; yacc: 318; perl: 82
file content (28 lines) | stat: -rw-r--r-- 1,636 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Description: Extends header line 2 (head2) with an extra byte for the terminating \0 and shortens two strings that were 1 byte too long.
## Origin/Author: Norvald H. Ryeng 
## Bug: https://bugs.launchpad.net/ubuntu/+source/predict/+bug/553140
Index: predict-2.2.3/predict-g1yyh.c
===================================================================
--- predict-2.2.3.orig/predict-g1yyh.c	2010-04-01 11:03:53.472663321 +0200
+++ predict-2.2.3/predict-g1yyh.c	2010-04-01 11:11:19.876662739 +0200
@@ -4018,7 +4018,7 @@
 	/* This function buffers and displays orbital predictions
 	   and allows screens to be saved to a disk file. */
 
-	char type[20], spaces[80], head1[80], head2[80];
+	char type[20], spaces[80], head1[80], head2[81];
 	int key, ans=0, l, x, t;
 	static char buffer[5000], lines, quit;
 	static FILE *fd;
@@ -4068,9 +4068,9 @@
 				sprintf(head2,"           Date     Mins/Day    Sun           Date     Mins/Day    Sun          ");
 			else {
 				if (calc_squint)
-					sprintf(head2,"           Date     Time    El   Az  Phase  %s   %s    Range  Squint         ",(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"));
+					sprintf(head2,"           Date     Time    El   Az  Phase  %s   %s    Range  Squint        ",(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"));
 				else
-					sprintf(head2,"           Date     Time    El   Az  Phase  %s   %s    Range   Orbit         ",(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"));
+					sprintf(head2,"           Date     Time    El   Az  Phase  %s   %s    Range   Orbit        ",(io_lat=='N'?"LatN":"LatS"),(io_lon=='W'?"LonW":"LonE"));
 			}
 		}