pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/44543: audio/mpg123 incorrectly interprets return value of getaddrinfo

>Number:         44543
>Category:       pkg
>Synopsis:       audio/mpg123 incorrectly interprets return value of getaddrinfo
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 10 03:35:03 +0000 2011
>Originator:     Taylor R Campbell <>
>Release:        NetBSD 5.1_STABLE
System: NetBSD smalltalk.local 5.1_STABLE NetBSD 5.1_STABLE (RIADEBUG) #0: Tue 
Feb 1 20:28:45 UTC 2011 
Architecture: i386
Machine: i386

        mpg123 assumes that only negative values from getaddrinfo imply
        errors, whereas in fact any nonzero value implies error, and on
        NetBSD, the GAI_* values are positive, so that if the resolver
        fails on NetBSD, then mpg123 crashes when interprets garbage as
        a struct addrinfo pointer.


        Install audio/mpg123.  Then:

% mpg123 http://bogus.nonexistent/
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
        version 1.12.5; written and copyright by Michael Hipp and others
        free software (LGPL/GPL) without any warranty but with best wishes
[resolver.c:306] error: Cannot resolve/connect to bogus.nonexistent:80!
zsh: segmentation fault (core dumped)  mpg123 http://bogus.nonexistent/


        Add the following patch to audio/mpg123/patches:


--- src/resolver.c.orig 2010-10-04 06:23:26.000000000 +0000
+++ src/resolver.c
@@ -283,7 +283,7 @@ int open_connection(mpg123_string *host,
        addrcount = getaddrinfo(host->p, port->p, &hints, &addrlist);
-       if(addrcount <0)
+       if(addrcount != 0)
                error3("Resolving %s:%s: %s", host->p, port->p, 
                return -1;

Home | Main Index | Thread Index | Old Index