File: fix_parse_diagram_c.patch

package info (click to toggle)
dia2code 0.8.3-4.4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 984 kB
  • sloc: ansic: 5,682; sh: 716; makefile: 19
file content (16 lines) | stat: -rw-r--r-- 590 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Check for valid pointer before calling strlen()
Author: Patrice Neff <software@patrice.ch>
Forwarded: yes
Last-Update: 2002-02-14

--- a/dia2code/parse_diagram.c
+++ b/dia2code/parse_diagram.c
@@ -498,7 +498,7 @@
     }
     implementator = find(classlist, id);
     free(id);
-    if (implementator != NULL && strlen(name) > 2) {
+    if (implementator != NULL && name != NULL && strlen(name) > 2) {
         interface = (umlclasslist) my_malloc (sizeof (umlclassnode));
         interface->key = (umlclass *) my_malloc (sizeof(umlclass));
         interface->parents = NULL;