AaronZhangL / unimrcp

Automatically exported from code.google.com/p/unimrcp
Apache License 2.0
0 stars 0 forks source link

Possible access violation in APT logger #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you try to log
apt_log(APT_LOG_MARK, APT_PRIO_WARNING, "We print string with %%s");
then the default logger function, apt_do_log at apt_log.c:260 tries to
print and format the log entry with
printf(log_entry);
which is in fact
printf("...some artifacts... We print string with %s");
You ought to use a non-formatting function:
fwrite(log_entry, offset, 1, stdout);
or alternatively
printf("%.*s", offset, log_entry);

Original issue reported on code.google.com by tomas.valenta@speechtech.cz on 18 Aug 2009 at 8:26

GoogleCodeExporter commented 9 years ago
Agreed and fixed in r1093.
Thanks

Original comment by achalo...@gmail.com on 18 Aug 2009 at 1:29

GoogleCodeExporter commented 9 years ago
Verified, thanks, works correctly now.

Original comment by tomas.valenta@speechtech.cz on 25 Aug 2009 at 10:09

GoogleCodeExporter commented 9 years ago
Thank you!

Original comment by achalo...@gmail.com on 25 Aug 2009 at 11:42