codership / galera

Synchronous multi-master replication library
GNU General Public License v2.0
447 stars 177 forks source link

Parsing of ISO 8601 durations accepts invalid representations #630

Closed sciascid closed 1 year ago

sciascid commented 1 year ago

This issue was originally raised in the context of this mariadb issue: https://jira.mariadb.org/browse/MDEV-30140 It is possible to set period type of galera parameters with bogus values. For example: "Panyvalue" will be parsed and accepted as "P", meaning a "zero" duration. It turns out that any value starting with "P" is accepted:

gu::datetime::Period("Pwhatever").get_nsecs();  // returns 0, instead of throwing an exception