ndevilla/iniparser — pull request #26 by touilleMan (2013-06-07 09:58:54+00:00)
Title: iniexample segfault if no write rights

I went into a error segfault :
```
# cd /
# /home/user/iniparser/test/iniexample
zsh: segmentation fault /home/user/iniparser/test/iniexample
```

The trouble is an user cannot create a file in the /, but the call to fopen is not checked !
Then a NULL pointer is used further in the function and lead to a segfault

I set a small fix :
```
# cd /
# /home/user/iniparser/test/iniexample
Cannot create example.ini (Permission denied)
iniparser: cannot open example.ini
cannot parse file: example.ini
```