On Sun, 2010-10-17 at 13:37 +0200, Bart Van Assche wrote:
> On Sun, Oct 17, 2010 at 1:26 PM, Magnus Fromreide
> <[email protected]> wrote:
>         On Sun, 2010-10-17 at 09:36 +0000,
>         [email protected] wrote:
>         > Revision: 19477
>         >
>         http://net-snmp.svn.sourceforge.net/net-snmp/?rev=19477&view=rev
>         > Author:   bvassche
>         > Date:     2010-10-17 09:36:11 +0000 (Sun, 17 Oct 2010)
>         >
>         > Log Message:
>         > -----------
>         > Fixed a few compiler warnings by inserting appropriate
>         casts.
>         
>         ...
>         >     trunk/net-snmp/snmplib/snmp_openssl.c
>         
>         
>         You add a couple of casts to const _STACK* here but I can't
>         find any
>         declaration of _STACK and neither can my compiler. What should
>         it be?
> 
> I'm not sure there is any other portable alternative than changing it
> into void.

With the attached patch it builds for me, do you see any other problems
with it?

/MF

Index: snmplib/snmp_openssl.c
===================================================================
--- snmplib/snmp_openssl.c	(revision 19478)
+++ snmplib/snmp_openssl.c	(working copy)
@@ -602,7 +602,7 @@
 
     /** check for a chain to a CA */
     ochain = SSL_get_peer_cert_chain(ssl);
-    if ((NULL == ochain) || (0 == sk_num((const _STACK *)ochain))) {
+    if ((NULL == ochain) || (0 == sk_num((const STACK *)ochain))) {
         DEBUGMSGT(("ssl:cert:chain", "peer has no cert chain\n"));
     }
     else {
@@ -610,8 +610,8 @@
          * loop over chain, adding fingerprint / cert for each
          */
         DEBUGMSGT(("ssl:cert:chain", "examining cert chain\n"));
-        for(i = 0; i < sk_num((const _STACK *)ochain); ++i) {
-            ocert_tmp = (X509*)sk_value((const _STACK *)ochain,i);
+        for(i = 0; i < sk_num((const STACK *)ochain); ++i) {
+            ocert_tmp = (X509*)sk_value((const STACK *)ochain,i);
             fingerprint = netsnmp_openssl_cert_get_fingerprint(ocert_tmp,
                                                                NS_HASH_SHA1);
             if (NULL == fingerprint)
@@ -629,7 +629,7 @@
         /*
          * if we broke out of loop before finishing, clean up
          */
-        if (i < sk_num((const _STACK *)ochain)) 
+        if (i < sk_num((const STACK *)ochain)) 
             CONTAINER_FREE_ALL(chain_map, NULL);
     } /* got peer chain */
 
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to