[PATCH] fix segfault when running with $HOME unset
Reported by Maxim Mikityanskiy | June 4th, 2012 @ 02:29 PM | in 1.2.0 Release
When libimobiledevice is running in environment without $XDG_CONFIG_HOME and $HOME set, segfault happens at src/userpref.c:128 in function userpref_get_config_dir() when calling strcpy(), because variable cdir is set to NULL and strcpy() tries to read from NULL.
For example, this situation happens when upowerd starts at boot if iPod touch is plugged into computer. Upowerd runs with clean environment and crashes in libimobiledevice when coldplugs iPod.
I propose attached patch to fix this bug.
Comments and changes to this ticket
-
Samuli Suominen August 5th, 2012 @ 01:09 PM
Duplicate of this ticket:
http://libiphone.lighthouseapp.com/projects/27916-libiphone/tickets...
-
Martin S. September 5th, 2012 @ 12:17 PM
- State changed from new to duplicate
- Assigned user set to Martin S.
- Milestone set to 1.2.0 Release
- Milestone order changed from 190966 to 0
Thanks, fixed in #265 and pushed to master.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A project around supporting the iPhone in Linux.
See http://libimobiledevice.org
People watching this ticket
Attachments
Referenced by
- 265 userpref_get_config_dir() segfaults when $HOME is undefined http://libiphone.lighthouseapp.com/projects/27916-libiph...
- 265 userpref_get_config_dir() segfaults when $HOME is undefined This is a more complete patch than the one in ticket #273...
- 331 Insecure tmp directory use That bug had a duplicate marked for it, http://libiphone...