Re: Glib->log() and %-style format strings

Torsten Schoenfeld wrote:

this always produces a segmentation fault on my machine:

   perl -MGlib -e'Glib->log(q/Test/, qw/warning/, q(%s %s));'

The reason is that we pass the message string ("%s %s" in this case) unaltered
down to g_log():

   g_log (log_domain, SvGLogLevelFlags (log_level), message);

Well, that should be

   g_log (log_domina, SvGLogLevelFlags (log_level), "%s", message);

in order to protect against nasty embedded % chars.

I don't think that g_log() provides any formatting features that perl doesn't
already trump.

(I'm surprised, i thought we'd fixed that long ago.)

muppet <scott at asofyet dot org>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]