miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Segmentation fault while parsing config

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs
View previous topic :: View next topic  
Author Message
jimmywei



Joined: 10 Jan 2008
Posts: 8

PostPosted: Mon Jan 14, 2008 10:22 am    Post subject: Segmentation fault while parsing config Reply with quote

miniupnpd: miniupnpd-1.0-RC13
file:option.c
platform:Fedora Core 3

I am using default config with some modification (listening ip...)
I noticed that sometimes it crashes... (Segmentation fault), and i try to find out what was wrong, i found that if it crashed, it always crashed when parsing an empty line in configuration file line 7,

for example:
in default config,
line 6 #ext_ip=
line 7
line 8 # there can be ...

it crashed in parsing line 7

then i add

while(fgets(buffer, sizeof(buffer),hfile))
{
linenum++;
t=strchr(buffer,'\n');
if(t)
{
*t='\0';
t--;
if(t<=buffer)
continue;

while(isspace(*t))
{
...



then tried many times, it did not crash

I don't know if this is right,
Hope this would be helpful Smile
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Mon Jan 14, 2008 11:24 am    Post subject: Reply with quote

thank you for noticing this bug !
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1589

PostPosted: Sun Jan 27, 2008 11:03 pm    Post subject: Reply with quote

the bug is corrected in MiniUPnPd version 1.0
_________________
Main miniUPnP author.
https://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpd Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.