{"action":"created","issue":{"url":"https://api.github.com/repos/mate-desktop/caja/issues/747","repository_url":"https://api.github.com/repos/mate-desktop/caja","labels_url":"https://api.github.com/repos/mate-desktop/caja/issues/747/labels{/name}","comments_url":"https://api.github.com/repos/mate-desktop/caja/issues/747/comments","events_url":"https://api.github.com/repos/mate-desktop/caja/issues/747/events","html_url":"https://github.com/mate-desktop/caja/issues/747","id":215085611,"number":747,"title":"caja segfault due to uninitialized variable","user":{"login":"rnagy","id":166914,"avatar_url":"https://avatars1.githubusercontent.com/u/166914?v=3","gravatar_id":"","url":"https://api.github.com/users/rnagy","html_url":"https://github.com/rnagy","followers_url":"https://api.github.com/users/rnagy/followers","following_url":"https://api.github.com/users/rnagy/following{/other_user}","gists_url":"https://api.github.com/users/rnagy/gists{/gist_id}","starred_url":"https://api.github.com/users/rnagy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rnagy/subscriptions","organizations_url":"https://api.github.com/users/rnagy/orgs","repos_url":"https://api.github.com/users/rnagy/repos","events_url":"https://api.github.com/users/rnagy/events{/privacy}","received_events_url":"https://api.github.com/users/rnagy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-03-17T18:25:38Z","updated_at":"2017-03-17T18:42:59Z","closed_at":"2017-03-17T18:41:16Z","body":"Caja crashed due to the uninitialized geometry variable in caja_application_open(),\r\nif there is no geometry specified on the command line:\r\n\r\n```\r\nCore was generated by 'caja'.\r\nProgram terminated with signal SIGSEGV, Segmentation fault.\r\n#0  0x00001da950b04398 in XParseGeometry () from /usr/X11R6/lib/libX11.so.16.1\r\n[Current thread is 1 (process 397413)]\r\n(gdb) bt\r\n#0  0x00001da950b04398 in XParseGeometry () from /usr/X11R6/lib/libX11.so.16.1\r\n#1  0x00001da706594175 in eel_gdk_parse_geometry (string=<optimized out>, x_return=<optimized out>, y_return=<optimized out>, width_return=<optimized out>, \r\n    height_return=<optimized out>) at eel-gdk-extensions.c:460\r\n#2  0x00001da70659c04d in eel_gtk_window_set_initial_geometry_from_string (window=0x1da94c3fc3c0, \r\n    geometry_string=0x1 <error: Cannot access memory at address 0x1>, minimum_width=300, minimum_height=100, ignore_position=0) at eel-gtk-extensions.c:244\r\n#3  0x00001da70650a958 in open_window (application=0x1da9a8f68150, location=0x1da98a68f4a0, screen=0x1da94d58a0b0, \r\n    geometry=0x1 <error: Cannot access memory at address 0x1>, browser_window=<optimized out>) at caja-application.c:281\r\n#4  0x00001da70650aa2d in caja_application_open (app=<optimized out>, files=0x1da91b489020, n_files=<optimized out>, options=<optimized out>)\r\n    at caja-application.c:349\r\n#5  0x00001da957b317c4 in ffi_call_unix64 () from /usr/local/lib/libffi.so.1.2\r\n#6  0x00001da957b315d1 in ffi_call () from /usr/local/lib/libffi.so.1.2\r\n#7  0x00001da97d83d7b6 in g_cclosure_marshal_generic_va () from /usr/local/lib/libgobject-2.0.so.4200.4\r\n#8  0x00001da97d83f3ed in _g_closure_invoke_va () from /usr/local/lib/libgobject-2.0.so.4200.4\r\n#9  0x00001da97d857846 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.4200.4\r\n#10 0x00001da97d858a41 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.4200.4\r\n#11 0x00001da706509b2c in caja_application_local_command_line (application=0x1da9a8f68150, arguments=0x7f7ffffec3d0, exit_status=<optimized out>)\r\n    at caja-application.c:2190\r\n#12 0x00001da941ee2031 in g_application_run () from /usr/local/lib/libgio-2.0.so.4200.4\r\n#13 0x00001da70651ce56 in main (argc=1, argv=0x7f7ffffec4b8) at caja-main.c:295\r\n```\r\n\r\nThe fix:\r\n\r\n```\r\n--- src/caja-application.c.orig Fri Mar 17 19:18:34 2017\r\n+++ src/caja-application.c      Fri Mar 17 19:18:38 2017\r\n@@ -319,7 +319,7 @@ caja_application_open (GApplication *app,\r\n {\r\n     CajaApplication *self = CAJA_APPLICATION (app);\r\n     gboolean browser_window = FALSE;\r\n-    const gchar *geometry;\r\n+    const gchar *geometry = NULL;\r\n     const char splitter = '=';\r\n \r\n     g_debug (\"Open called on the GApplication instance; %d files\", n_files);\r\n```"},"comment":{"url":"https://api.github.com/repos/mate-desktop/caja/issues/comments/287439192","html_url":"https://github.com/mate-desktop/caja/issues/747#issuecomment-287439192","issue_url":"https://api.github.com/repos/mate-desktop/caja/issues/747","id":287439192,"user":{"login":"lukefromdc","id":14036792,"avatar_url":"https://avatars2.githubusercontent.com/u/14036792?v=3","gravatar_id":"","url":"https://api.github.com/users/lukefromdc","html_url":"https://github.com/lukefromdc","followers_url":"https://api.github.com/users/lukefromdc/followers","following_url":"https://api.github.com/users/lukefromdc/following{/other_user}","gists_url":"https://api.github.com/users/lukefromdc/gists{/gist_id}","starred_url":"https://api.github.com/users/lukefromdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukefromdc/subscriptions","organizations_url":"https://api.github.com/users/lukefromdc/orgs","repos_url":"https://api.github.com/users/lukefromdc/repos","events_url":"https://api.github.com/users/lukefromdc/events{/privacy}","received_events_url":"https://api.github.com/users/lukefromdc/received_events","type":"User","site_admin":false},"created_at":"2017-03-17T18:42:59Z","updated_at":"2017-03-17T18:42:59Z","body":"While this never segfaulted on any of my systems, differences in compilers or libraries could explain that-and in any case an uninitialized variable is an error. Thanks for catching this. I never got a compiler warning about this nor a runtime warning."}}
{"actor":{"display_login":"lukefromdc"}}