Re: Troubleshooting segfault

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

 





On 8/5/05, Jan-Espen Pettersen <sigsegv@xxxxxxxxxxxxx> wrote:
Jonathan Hayward wrote:

> I've been developing an application, and now it crashes shortly after
> starting; it segfaults (secondary damage?) either on the first attempt
> to strncpy() from a text input, or gtk_image_new_from_pixbuf(). Both
> of these were working reliably, and I haven't touched that area of
> code (but double checked just in case).

In:
void user_entered_string(GtkWidget *window)
    {
    user_has_clicked = 1;
    user_clicked_value = 1;
    strncpy(entry_text, gtk_entry_get_text(GTK_ENTRY(entry)),
      ENTRY_TEXT_LENGTH);
    entry_text[ENTRY_TEXT_LENGTH - 1] = '\0';
    gtk_widget_destroy(window);
    }

from gtk.c, there is an uninitialized usage of the entry_text pointer.
This pointer is never set. There is a possible harmful usage of calloc
in gtk_specific_init, but it didn't run at all here.

Thanks--it's working now!




--
++ Jonathan Hayward, jonathan.hayward@xxxxxxxxx
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com

** If you'd like a Google Mail (gmail.com) account, please tell me!
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux