1.3.77: Crash On Linux When Sync Folder In Under Symlink Directory


Szpadel

Recommended Posts

When Sync folder is under an symlinked directory btsync 1.3.77 crashes when starting with:

 

*** Error in `./bin/btsync': free(): invalid next size (fast): 0x00007ffcf82c7670 ***
======= Backtrace: =========
/lib64/libc.so.6[0x33b4e7548e]
/lib64/libc.so.6[0x33b4e7b1fd]
/lib64/libc.so.6[0x33b4e7bf66]
./bin/btsync[0x47643f]
./bin/btsync[0x4d7264]
./bin/btsync[0x4e10ef]
./bin/btsync[0x4dfad3]
./bin/btsync[0x4dffb5]
./bin/btsync[0x46e50a]
./bin/btsync[0x46e583]
./bin/btsync[0x4d3b13]
./bin/btsync[0x505758]
./bin/btsync[0x491bfc]
/lib64/libpthread.so.0[0x33b5608333]
/lib64/libc.so.6(clone+0x6d)[0x33b4eeb26d]
 

this configuration worked well with btsync 1.2.82

 

Loaded folder contains truncated path with real path

 

/home is symlink to /home-bulk

btsync loading folder: /home-bulk/ziomek/Sync/La instead of /home/ziomek/Sync/Laptop

 

Link to comment
Share on other sites

Mhhh...

 

int physlen = sizeof("/home/ziomek/Sync/Laptop");printf ("Physical Length is: %i\n", physlen);// Physical Length is: 25// ...think about the trailing 0 ("\0")// now resolve the link and write it to the same buffer or to a buffer of the same size...char *newstr = pseudo_resolve_link("/home/ziomek/Sync/Laptop")printf ("Real path: %s\n", newstr);// Real path: /home-bulk/ziomek/Sync/Laptopchar szTemp[256];memset (szTemp, 0, sizeof(szTemp));strncpy (szTemp, newstr, physlen);printf ("Et voila: %s\n", szTemp);// Et voila: /home-bulk/ziomek/Sync/Laprintf ("Length: %i\n", strlen(szTemp));// Length: 25// (the same as physlen)
Maybe the symbolic link resolver does it in-place (and maybe overwrites also other memory?)...
Link to comment
Share on other sites

Since the resolved is cut exactly at the physical length of the name of the symbolic link, I suppose that you are right. I think that the developers have added the resolving of symbolic links later, but forgot to allocate a new memory location for the result...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.