aboutsummaryrefslogtreecommitdiff
path: root/overflow.patch
blob: a70026694eca3cba8164d19c27d745435e3a375f (plain) (blame)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
--- a/src/naemon/xodtemplate.c	2019-07-03 18:34:13.795379190 +0200
+++ b/src/naemon/xodtemplate.c	2019-07-03 18:33:37.079085158 +0200
@@ -7488,7 +7488,7 @@
 				} else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
 					temp_host->flap_detection_options = OPT_ALL;
 				} else {
-					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", temp_ptr);
+					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid flap detection option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 					result = ERROR;
 				}
 			}
@@ -7510,7 +7510,7 @@
 				} else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
 					temp_host->notification_options = OPT_ALL;
 				} else {
-					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", temp_ptr);
+					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid notification option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 					result = ERROR;
 				}
 			}
@@ -7537,7 +7537,7 @@
 				} else if (!strcmp(temp_ptr, "a") || !strcmp(temp_ptr, "all")) {
 					temp_host->stalking_options = OPT_ALL;
 				} else {
-					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", temp_ptr);
+					nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid stalking option '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 					result = ERROR;
 				}
 			}
@@ -7549,29 +7549,29 @@
 			xodtemplate_obsoleted(variable, temp_host->_start_line);
 		} else if (!strcmp(variable, "2d_coords")) {
 			if ((temp_ptr = strtok(value, ", ")) == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_host->x_2d = atoi(temp_ptr);
 			if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_host->y_2d = atoi(temp_ptr);
 			temp_host->have_2d_coords = TRUE;
 		} else if (!strcmp(variable, "3d_coords")) {
 			if ((temp_ptr = strtok(value, ", ")) == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_host->x_3d = strtod(temp_ptr, NULL);
 			if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_host->y_3d = strtod(temp_ptr, NULL);
 			if ((temp_ptr = strtok(NULL, ", ")) == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in host definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_host->z_3d = strtod(temp_ptr, NULL);
@@ -8176,13 +8176,13 @@
 		} else if (!strcmp(variable, "2d_coords")) {
 			temp_ptr = strtok(value, ", ");
 			if (temp_ptr == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_hostextinfo->x_2d = atoi(temp_ptr);
 			temp_ptr = strtok(NULL, ", ");
 			if (temp_ptr == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 2d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_hostextinfo->y_2d = atoi(temp_ptr);
@@ -8190,19 +8190,19 @@
 		} else if (!strcmp(variable, "3d_coords")) {
 			temp_ptr = strtok(value, ", ");
 			if (temp_ptr == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_hostextinfo->x_3d = strtod(temp_ptr, NULL);
 			temp_ptr = strtok(NULL, ", ");
 			if (temp_ptr == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_hostextinfo->y_3d = strtod(temp_ptr, NULL);
 			temp_ptr = strtok(NULL, ", ");
 			if (temp_ptr == NULL) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", temp_ptr);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Invalid 3d_coords value '%s' in extended host info definition.\n", (temp_ptr ? temp_ptr : "(null)"));
 				return ERROR;
 			}
 			temp_hostextinfo->z_3d = strtod(temp_ptr, NULL);
@@ -8369,21 +8369,21 @@
 
 			/* make sure an object type is specified... */
 			if (input[0] == '\x0') {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, current_line);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: No object type specified in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
 				result = ERROR;
 				break;
 			}
 
 			/* we're already in an object definition... */
 			if (in_definition == TRUE) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d.  Make sure you close preceding objects before starting a new one.\n", filename, current_line);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Unexpected start of object definition in file '%s' on line %d.  Make sure you close preceding objects before starting a new one.\n", filename, (current_line ? current_line : -1));
 				result = ERROR;
 				break;
 			}
 
 			/* start a new definition */
 			if (xodtemplate_begin_object_definition(input, xodtemplate_current_config_file, current_line) == ERROR) {
-				nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, current_line);
+				nm_log(NSLOG_CONFIG_ERROR, "Error: Could not add object definition in file '%s' on line %d.\n", filename, (current_line ? current_line : -1));
 				result = ERROR;
 				break;
 			}
@@ -8401,7 +8401,7 @@
 
 				/* close out current definition */
 				if (xodtemplate_end_object_definition() == ERROR) {
-					nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, current_line);
+					nm_log(NSLOG_CONFIG_ERROR, "Error: Could not complete object definition in file '%s' on line %d. Have you named all your objects?\n", filename, (current_line ? current_line : -1));
 					result = ERROR;
 					break;
 				}