[PATCH] fix segfault when running with $HOME unset
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
Duplicate of this ticket: