jcline / fuse-google-drive

A fuse filesystem wrapper for Google Drive.
GNU General Public License v2.0
285 stars 48 forks source link

Segfault when looping through xmldoc nodes #18

Closed antimirov closed 12 years ago

antimirov commented 12 years ago

$ ./fuse-google-drive ~/work/GoogleDrive Please open this in a web browser and authorize fuse-google-drive: ... Once you authenticate, Google should give you a code, please paste it here: ...

Program terminated with signal 11, Segmentation fault.

0 0x0804aae0 in gdi_get_file_list (path=0x804b4b7 "/", state=0xbfebe5dc) at gd_interface.c:596

596 for(node = xmldoc->children->children; node != NULL; node = node->next) (gdb) bt

0 0x0804aae0 in gdi_get_file_list (path=0x804b4b7 "/", state=0xbfebe5dc) at gd_interface.c:596

1 0x0804a584 in gdi_init (state=0xbfebe5dc) at gd_interface.c:479

2 0x08049365 in main (argc=2, argv=0xbfebe6b4) at gd_fuse_operations.c:450

jcline commented 12 years ago

You may want to add a printf("%s\n",(char*)data); in curl_get_list_callback() to make sure you are actually getting something usable back from Google. It's possible that loop will segfault if Google sends back some XML without the exact formatting currently expected. (I plan on adding better error handling once I get the rest of the directory listing stuff done.)

jcline commented 12 years ago

I may have fixed this in commit e53ad6619d5f56fe8b9785f5cd881e534ba0a09e. Let me know.

antimirov commented 12 years ago

Segfault has been fixed. Thanks!