corosync/0005-do-not-convert-empty-uid-gid-to-0.patch
Bin Liu 868d6de717 Accepting request 571270 from home:BinLiu:branches:network:ha-clustering:Factory
- corosync exposes itself for a self-crash under rare circumstance(bsc#1078412)
    Added: 0013-logging-Make-blackbox-configurable.patch
           0014-logging-Close-before-and-open-blackbox-after-fork.patch
    Modified: remove unncessary git commit messages
           0001-coroapi-Use-size_t-for-private_data_size.patch
           0002-fix-ifdown-udp.patch
           0005-do-not-convert-empty-uid-gid-to-0.patch
           0008-wd-fix-snprintf-warnings.patch
           0010-qdevice-mv-free-str-after-port-validation.patch
           0011-libcpg-Fix-issue-with-partial-big-packet-assembly.patch
           0012-totemudp-u-Drop-truncated-packets-on-receive.patch

OBS-URL: https://build.opensuse.org/request/show/571270
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=133
2018-01-31 06:32:47 +00:00

34 lines
892 B
Diff

diff --git a/exec/coroparse.c b/exec/coroparse.c
index 374ed7dd..ac654a11 100644
--- a/exec/coroparse.c
+++ b/exec/coroparse.c
@@ -139,6 +139,12 @@ static int uid_determine (const char *req_user)
long int id;
char *ep;
+ if(*req_user == '\0') {
+ sprintf (error_string_response,
+ "The user can not be empty, please read the documentation.");
+ return (-1);
+ }
+
id = strtol(req_user, &ep, 10);
if (*ep == '\0' && id >= 0 && id <= UINT_MAX) {
return (id);
@@ -193,6 +199,12 @@ static int gid_determine (const char *req_group)
long int id;
char *ep;
+ if(*req_group == '\0') {
+ sprintf (error_string_response,
+ "The group can not be empty, please read the documentation.");
+ return (-1);
+ }
+
id = strtol(req_group, &ep, 10);
if (*ep == '\0' && id >= 0 && id <= UINT_MAX) {
return (id);
--
2.13.6