Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6375 closed defect (invalid)

Using libpurple's time/date formatting in perl crashes Pidgin

Reported by: Fooble Owned by:
Milestone: Component: libpurple
Version: 2.4.3 Keywords: time date format perl crash
Cc:

Description

Here's the perl code that causes a crash:

$time = Purple::Util::time_build(2008, 7, 18, 18, 12, 0);
$time_str = Purple::Util::time_format($time);

Other time/date formatting methods seem to crash it also. I tried Purple::Util::Date::format_short and Purple::Util::utf8_strftime.

I attached a pidgin.RPT file. It looked like it had some useful information.

Attachments (1)

pidgin.RPT (5.1 KB) - added by Fooble 11 years ago.

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by Fooble

comment:1 Changed 11 years ago by datallah

  • Resolution set to invalid
  • Status changed from new to closed

Purple::Util::time_build() returns a time_t (which is a number of the milliseconds since the epoch) and Purple::Util::time_format() expects a struct tm

Why don't you just use the built-in perl functions for parsing and formatting a date?

comment:2 Changed 11 years ago by Fooble

Yeah, that's where I was going next.

comment:3 Changed 11 years ago by deryni

I'm sort of surprised doing that didn't cause anything to scream loudly.

comment:4 Changed 11 years ago by datallah

What's louder than a crash?

comment:5 Changed 11 years ago by deryni

What I meant was I'm surprised the perl wrappers didn't type check the input and scream about that instead of passing it to C and having the C blow up.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!