After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 405006 - zenity --text-info --editable crashes on files with printf-formatted strings
zenity --text-info --editable crashes on files with printf-formatted strings
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-02-06 14:59 UTC by Áron Sisak
Modified: 2007-05-14 22:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18


Attachments
Patch to fix issue with printf format string (622 bytes, patch)
2007-02-06 19:49 UTC, Áron Sisak
none Details | Review
Simply do g_print ("%s", string_possibly_containing_percent_chars); (723 bytes, patch)
2007-02-07 05:54 UTC, Mariano Suárez-Alvarez
none Details | Review

Description Áron Sisak 2007-02-06 14:59:21 UTC
This bug has been opened here: https://launchpad.net/ubuntu/+source/zenity/+bug/83549

Zenity segfaults if used in editable mode with files that contain special printf format strings. If we escape format strings (e.g. via sed) nothing

More detailed information available in the Ubuntu bugreport.
Comment 1 Áron Sisak 2007-02-06 15:03:11 UTC
Debug backgtrace:

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 14461)

  • #0 strlen
    from /lib/libc.so.6
  • #1 fputs
    from /lib/libc.so.6
  • #2 IA__g_print
  • #3 zenity_text_dialog_response
    at text.c line 164
  • #4 IA__g_cclosure_marshal_VOID__INT
    at gmarshal.c line 216
  • #5 IA__g_closure_invoke
    at gclosure.c line 490
  • #6 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #7 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #8 IA__g_signal_emit
    at gsignal.c line 2243
  • #9 IA__gtk_dialog_response
    at gtkdialog.c line 835
  • #10 action_widget_activated
    at gtkdialog.c line 534
  • #11 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #12 IA__g_closure_invoke
    at gclosure.c line 490
  • #13 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #14 IA__g_signal_emit_valist
    at gsignal.c line 2199
  • #15 IA__g_signal_emit
    at gsignal.c line 2243
  • #16 IA__gtk_button_clicked
    at gtkbutton.c line 889
  • #17 gtk_real_button_released
    at gtkbutton.c line 1484
  • #18 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #19 g_type_class_meta_marshal
    at gclosure.c line 567
  • #20 IA__g_closure_invoke
    at gclosure.c line 490
  • #21 signal_emit_unlocked_R
    at gsignal.c line 2370
  • #22 IA__g_signal_emit_valist

Comment 2 Áron Sisak 2007-02-06 19:49:29 UTC
Created attachment 82037 [details] [review]
Patch to fix issue with printf format string

There might be an easier way to do this, however I could not find a glib function for replacing strings.
Comment 3 Mariano Suárez-Alvarez 2007-02-07 05:54:15 UTC
Created attachment 82066 [details] [review]
Simply do g_print ("%s", string_possibly_containing_percent_chars);
Comment 4 Mariano Suárez-Alvarez 2007-02-07 06:16:56 UTC
Maybe using "%s\n" as the format string is better?
Comment 5 jno 2007-02-07 07:05:00 UTC
g_print ("%s", string_possibly_containing_percent_chars);
should be enough. "%s\n" is an overkill. i see no need in extra chars to be appened (this may lead to unneeded file growth, if used as an "editor").
Comment 6 Tom Tromey 2007-02-08 19:26:46 UTC
FWIW this patch looks reasonable to me (not that this means anything
official :-).  It also seems to fix a memory leak.
Comment 7 Lucas Rocha 2007-05-14 22:13:10 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.

2007-05-15  Lucas Rocha  <lucasr@gnome.org>

        * src/text.c (zenity_text_dialog_response): fix seg fault when
        outputing files with special printf format strings (Fixes
        bug #405006). Patch from Mariano Suárez-Alvarez.