Blame SOURCES/0211-RH-strlen-fix.patch
|
|
d88bf6 |
---
|
|
|
d88bf6 |
multipathd/main.c | 9 ++++++---
|
|
|
d88bf6 |
1 file changed, 6 insertions(+), 3 deletions(-)
|
|
|
d88bf6 |
|
|
|
d88bf6 |
Index: multipath-tools-130222/multipathd/main.c
|
|
|
d88bf6 |
===================================================================
|
|
|
d88bf6 |
--- multipath-tools-130222.orig/multipathd/main.c
|
|
|
d88bf6 |
+++ multipath-tools-130222/multipathd/main.c
|
|
|
d88bf6 |
@@ -878,7 +878,8 @@ uxsock_trigger (char * str, char ** repl
|
|
|
d88bf6 |
(strncmp(str, "list", strlen("list")) != 0) &&
|
|
|
d88bf6 |
(strncmp(str, "show", strlen("show")) != 0)) {
|
|
|
d88bf6 |
*reply = STRDUP("permission deny: need to be root");
|
|
|
d88bf6 |
- *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
+ if (*reply)
|
|
|
d88bf6 |
+ *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
r = 1;
|
|
|
d88bf6 |
goto out;
|
|
|
d88bf6 |
}
|
|
|
d88bf6 |
@@ -887,12 +888,14 @@ uxsock_trigger (char * str, char ** repl
|
|
|
d88bf6 |
|
|
|
d88bf6 |
if (r > 0) {
|
|
|
d88bf6 |
*reply = STRDUP("fail\n");
|
|
|
d88bf6 |
- *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
+ if (*reply)
|
|
|
d88bf6 |
+ *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
r = 1;
|
|
|
d88bf6 |
}
|
|
|
d88bf6 |
else if (!r && *len == 0) {
|
|
|
d88bf6 |
*reply = STRDUP("ok\n");
|
|
|
d88bf6 |
- *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
+ if (*reply)
|
|
|
d88bf6 |
+ *len = strlen(*reply) + 1;
|
|
|
d88bf6 |
r = 0;
|
|
|
d88bf6 |
}
|
|
|
d88bf6 |
/* else if (r < 0) leave *reply alone */
|