Send inn-committers mailing list submissions to
        inn-committers@lists.isc.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.isc.org/mailman/listinfo/inn-committers
or, via email, send a message with subject or body 'help' to
        inn-committers-requ...@lists.isc.org

You can reach the person managing the list at
        inn-committers-ow...@lists.isc.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of inn-committers digest..."


Today's Topics:

   1. INN commit: branches/2.5/lib (getnameinfo.c) (INN Commit)


----------------------------------------------------------------------

Message: 1
Date: Sun, 10 Nov 2013 10:30:25 -0800 (PST)
From: INN Commit <r...@isc.org>
To: inn-committ...@isc.org
Subject: INN commit: branches/2.5/lib (getnameinfo.c)
Message-ID: <20131110183025.d570167...@hope.eyrie.org>

    Date: Sunday, November 10, 2013 @ 10:30:25
  Author: iulius
Revision: 9565

getnameinfo.c:  sync with rra-c-util

Check the return status of snprintf instead of assuming that
it will always succeed.

Modified:
  branches/2.5/lib/getnameinfo.c

---------------+
 getnameinfo.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Modified: getnameinfo.c
===================================================================
--- getnameinfo.c       2013-11-10 18:27:16 UTC (rev 9564)
+++ getnameinfo.c       2013-11-10 18:30:25 UTC (rev 9565)
@@ -111,6 +111,7 @@
 {
     struct servent *srv;
     const char *protocol;
+    int status;
 
     /* Do the name lookup first unless told not to. */
     if (!(flags & NI_NUMERICSERV)) {
@@ -125,7 +126,8 @@
     }
 
     /* Just convert the port number to ASCII. */
-    if ((socklen_t) snprintf(service, servicelen, "%hu", port) > servicelen)
+    status = snprintf(service, servicelen, "%hu", port);
+    if (status < 0 || (socklen_t) status > servicelen)
         return EAI_OVERFLOW;
     return 0;
 }



------------------------------

_______________________________________________
inn-committers mailing list
inn-committers@lists.isc.org
https://lists.isc.org/mailman/listinfo/inn-committers

End of inn-committers Digest, Vol 57, Issue 6
*********************************************

Reply via email to