Bug 192648 - [PATCH] net/belle-sip 1.3.0_1 resolv bug causes crash when using net/linphone 3.7.0,1 [FBSD 10.0]
Summary: [PATCH] net/belle-sip 1.3.0_1 resolv bug causes crash when using net/linphone...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-14 07:12 UTC by Dom F
Modified: 2014-08-17 12:08 UTC (History)
2 users (show)

See Also:


Attachments
patch for net/belle-sip 1.3.0_1: files/patch-src_dns.c (269 bytes, text/x-csrc)
2014-08-14 07:12 UTC, Dom F
no flags Details
patch for belle-sip-1.3.0_2 (1.67 KB, patch)
2014-08-17 04:59 UTC, Muhammad Moinur Rahman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dom F 2014-08-14 07:12:50 UTC
Created attachment 145767 [details]
patch for net/belle-sip 1.3.0_1: files/patch-src_dns.c

I built linphone, which required belle-sip, from ports.

When running linphone, going to menu "Options" -> "Preferences" opens a "Settings" window. On the "Network settings" tab, check "Behind NAT / Firewall (use STUN to resolve)". After this, type into the "Stun server:" text input box. On the first key press linphone crashes.

It seems that linphone attempts to resolve the hostname in the text box after every keypress. This in turn calls belle-sip's dns_resconf_loadfromresolv() in src/dns.c:4304. The crash is at line 4309 "if ((error = res_ninit(&res))) {" caused by res_ninit() being passed a pointer to a struct -that has not been initialized-.

The fix is simply to insert the following before line 4309:

bzero(&res, sizeof(res));

(patch also attached for saving into net/belle-sip/files/)

Probably needs bouncing upstream.
Comment 1 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2014-08-17 04:59:15 UTC
Created attachment 145902 [details]
patch for belle-sip-1.3.0_2
Comment 2 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2014-08-17 05:04:47 UTC
Modifified some stuffs including optionsng. And properly installing pkg-config data. And fixed the dns issue.

Poudriere logs are as following:
http://pdr.s.ubze.ro/bulk/latest-per-pkg/belle-sip/1.3.0_2/
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-08-17 12:03:43 UTC
A commit references this bug:

Author: tijl
Date: Sun Aug 17 12:03:34 UTC 2014
New revision: 365177
URL: http://svnweb.freebsd.org/changeset/ports/365177

Log:
  - Add patch to initialise a struct before calling res_ninit [1]
  - Remove --enable-debug because it doesn't do anything

  PR:		192648
  Submitted by:	Dom F <freebsd@talk2dom.com> [1]
  Approved by:	Muhammad Moinur Rahman <5u623l20@gmail.com> (maintainer)

Changes:
  head/net/belle-sip/Makefile
  head/net/belle-sip/files/patch-src_dns.c
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2014-08-17 12:08:54 UTC
I've committed the patch but simply remove the --enable-debug handling, because it only adds -g to CFLAGS and bsd.port.mk already handles that.  The pkgconfig fix is already handled by USES=pathfix.