[DateTime] posix_time_zone constructor crashes with bad format string

Hello, I'm using Boost 1.34.1 with Visual Studio 2005 SP1. I've found that if the posix_time_zone constructor is invoked with certain types of invalid time zone string, the application crashes with an attempt to dereference an invalid iterator. Examples of strings that do this are strings with no digits, e.g. "UTC" and strings with a daylight saving time named but no changeover rules, such as "GMT0BST". This is a problem for us as in our application the time zone string is input by the user, and we need to fail gracefully if the user naively supplies an invalid string such as the two above. I think this is easily fixed by testing the iterators against end(), although I'm not quite sure which exception to throw in this case. Any ideas? TIA, Richard.
participants (1)
-
Richard Buckle