diff options
author | Liong Sauw Ming <ming@teluu.com> | 2013-02-27 10:16:08 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2013-02-27 10:16:08 +0000 |
commit | e0b9872e5b72532014d4f2fd8116662cc92fdf64 (patch) | |
tree | be3ac789db5892454d95b218849b56ebdcf24520 /pjlib/src/pj/sock_bsd.c | |
parent | 1703f7d9893e43ae31e81cb9de5b26420e2f6857 (diff) |
Re #1559: Backported to 1.x, except r4312,r4330
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4387 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/sock_bsd.c')
-rw-r--r-- | pjlib/src/pj/sock_bsd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c index 9bd0356f..358b9aef 100644 --- a/pjlib/src/pj/sock_bsd.c +++ b/pjlib/src/pj/sock_bsd.c @@ -718,7 +718,6 @@ PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock, { PJ_CHECK_STACK(); PJ_ASSERT_RETURN(buf && len, PJ_EINVAL); - PJ_ASSERT_RETURN(from && fromlen, (*len=-1, PJ_EINVAL)); *len = recvfrom(sock, (char*)buf, *len, flags, (struct sockaddr*)from, (socklen_t*)fromlen); @@ -726,7 +725,9 @@ PJ_DEF(pj_status_t) pj_sock_recvfrom(pj_sock_t sock, if (*len < 0) return PJ_RETURN_OS_ERROR(pj_get_native_netos_error()); else { - PJ_SOCKADDR_RESET_LEN(from); + if (from) { + PJ_SOCKADDR_RESET_LEN(from); + } return PJ_SUCCESS; } } |