Hi Andrew,
I got these ERROR messages with the latest pacemaker-dev.
pengine[27131]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left over
after parsing '120s': 's'
crmd[27128]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left over
after parsing '60s': 's'
Maybe the 2nd argument of crm_int_helper() should not be NULL
in new crm_get_msec().
As a trial, I applied the attached patch, no ERROR messages appeared.
(Please change the length of end_text to suitable one.)
Best Regards,
Satomi TANIGUCHI
Andrew Beekhof wrote:
Thanks!
Applied as:
http://hg.clusterlabs.org/pacemaker/dev/rev/c6326dbb9fac
2008/9/9 Satomi Taniguchi <[EMAIL PROTECTED]>:
Hi,
I found that crm_get_msec() is declared to return _unsigned_ long long,
but it tries to return a minus value in the following cases.
i) input strings consists of only character string.
ii) input strings means minus value.
In these cases, the return value is unexpected one like 1271310319.
I think this function should be declared to return _signed_ value,
but it is used in so many places without minus value check.
I tentatively created a patch , but I could'nt clarify its influence...
Anyway, I just want to use crm_get_msec()'s function safely.
If it is possible as it is, please let me know.
Regards,
Satomi Taniguchi
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
diff -r 631f119f8b19 lib/common/utils.c
--- a/lib/common/utils.c Fri Sep 12 00:51:33 2008 +0200
+++ b/lib/common/utils.c Fri Sep 12 16:30:40 2008 +0900
@@ -824,6 +824,8 @@
long long multiplier = 1000;
long long divisor = 1;
long long msec = -1;
+ char text[256];
+ char *end_text = text;
/* double dret; */
if(input == NULL) {
@@ -862,7 +864,7 @@
return msec;
}
- msec = crm_int_helper(cp, NULL);
+ msec = crm_int_helper(cp, end_text);
msec *= multiplier;
msec /= divisor;
/* dret += 0.5; */
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/