File: source-hardening.diff

package info (click to toggle)
grace 1%3A5.1.25-18
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,828 kB
  • sloc: ansic: 102,045; sh: 5,492; makefile: 572; fortran: 56; perl: 56
file content (68 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: Permit compilation with hardening flags in dpkg >= 1.16.0
Origin: vendor
Author: Nicholas Breen
Index: grace/src/utils.c
===================================================================
--- grace.orig/src/utils.c
+++ grace/src/utils.c
@@ -1171,12 +1171,12 @@ void stufftext(char *s)
     if (inwin) {
         stufftextwin(s);
     } else {
-        printf(s);
+        printf("%s", s);
     }
 #endif
     /* log results to file */
     if (resfp != NULL) {
-	fprintf(resfp, s);
+	fprintf(resfp, "%s", s);
     }
 }
 
@@ -1222,7 +1222,9 @@ int set_workingdir(const char *wd)
     char buf[GR_MAXPATHLEN];
     
     if (wd == NULL) {
-        getcwd(workingdir, GR_MAXPATHLEN - 1);
+        if (getcwd(workingdir, GR_MAXPATHLEN - 1) == NULL) {
+	    return RETURN_FAILURE;
+        }
         if (workingdir[strlen(workingdir)-1] != '/') {
             strcat(workingdir, "/");
         }
@@ -1389,7 +1391,7 @@ void clear_dirtystate(void)
     update_app_title();
 }
 
-void lock_dirtystate(flag)
+void lock_dirtystate(int flag)
 {
     dirtystate_lock = flag;
 }
Index: grace/src/svgdrv.c
===================================================================
--- grace.orig/src/svgdrv.c
+++ grace/src/svgdrv.c
@@ -745,7 +745,7 @@ void svg_puttext(VPoint vp, char *s, int
             -tm->cxy, -tm->cyy,
             scaleval(vp.x), scaleval(vp.y));
 
-    fprintf(prstream, escape_specials((unsigned char *) s, len));
+    fprintf(prstream, "%s", escape_specials((unsigned char *) s, len));
 
     fprintf(prstream, "</text>\n");
 }
Index: grace/auxiliary/Makefile
===================================================================
--- grace.orig/auxiliary/Makefile
+++ grace/auxiliary/Makefile
@@ -22,7 +22,7 @@ distclean : clean
 devclean : distclean
 
 convcal$(EXE) : convcal.c
-	$(CC) $(CFLAGS0) $(CPPFLAGS) -o $@ convcal.c $(NOGUI_LIBS)
+	$(CC) $(CFLAGS0) $(CPPFLAGS) -Wl,-z,relro -Wl,-z,now -o $@ convcal.c $(NOGUI_LIBS)
 
 install : $(AUXILIARIES) $(PROGRAMS) $(SCRIPTS)
 	$(MKINSTALLDIRS) $(DESTDIR)$(GRACE_HOME)/auxiliary