OSSP CVS Repository

ossp - Check-in [1241]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1241
Date: 2001-Oct-31 21:42:42 (local)
2001-Oct-31 20:42:42 (UTC)
User:rse
Branch:
Comment: Make sure we import only supported addresses on sa_addr_s2a().
Tickets:
Inspections:
Files:
ossp-pkg/sa/sa.c      1.38 -> 1.39     9 inserted, 0 deleted

ossp-pkg/sa/sa.c 1.38 -> 1.39

--- sa.c 2001/10/31 12:41:53     1.38
+++ sa.c 2001/10/31 20:42:42     1.39
@@ -614,6 +614,15 @@
     if (saa == NULL || sabuf == NULL || salen == 0)
         return SA_ERR_ARG;
 
+    /* make sure we import only supported addresses */
+    if (!(   sabuf->sa_family == AF_LOCAL
+          || sabuf->sa_family == AF_INET
+#ifdef AF_INET6
+          || sabuf->sa_family == AF_INET6
+#endif
+         ))
+        return SA_ERR_USE;
+
     /* create result address structure */
     if (saa->saBuf != NULL)
         free(saa->saBuf);

CVSTrac 2.0.1