#273 ✓duplicate
Maxim Mikityanskiy

[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

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.

New-ticket Create new ticket

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

Pages