Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#148 closed defect (fixed)

Crash when resolving bad hostnames in Linux (thanks Binu KS)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-
Component: pjlib Version:
Keywords: Cc:
Backport to 1.x milestone: Backported:


Binu K S reported:

PJSIP crashes in Linux when it tries to resolve a bad address. The problem is in pjlib/src/pj/addr_resolv_sock.c in the following lines:

   he = gethostbyname(copy);
    if (!he) {
	return pj_get_netos_error();

The gethostbyname call does not set any error code in errno in case of failures. The error is set in h_errno instead.

Change History (3)

comment:1 Changed 17 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r1022.

comment:2 Changed 17 years ago by bennylp

This actually has been fixed in, but it was invalidated by

comment:3 Changed 17 years ago by bennylp

Added test in pjlib-test to capture this error.

Note: See TracTickets for help on using tickets.