You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joe Orton <jo...@redhat.com> on 2007/09/13 05:15:16 UTC

[PATCH] fix types in ra_svn SASL stream functions

These are passing an (unsigned int *) to functions expecting an 
(apr_size_t *).

* subversion/libsvn_ra_svn/cyrus_auth.c (sasl_read_cb): Fix type of
length argument passed to svn_ra_svn__stream_read.
(sasl_write_cb): Fix type of length argument passed to
svn_ra_svn__stream_write.

Index: subversion/libsvn_ra_svn/cyrus_auth.c
===================================================================
--- subversion/libsvn_ra_svn/cyrus_auth.c	(revision 26572)
+++ subversion/libsvn_ra_svn/cyrus_auth.c	(working copy)
@@ -507,7 +507,7 @@ static svn_error_t *sasl_read_cb(void *b
   sasl_baton_t *sasl_baton = baton;
   int result;
   /* A copy of *len, used by the wrapped stream. */
-  unsigned int len2 = *len;
+  apr_size_t len2 = *len;
 
   /* sasl_decode might need more data than a single read can provide,
      hence the need to put a loop around the decoding. */
@@ -570,7 +570,7 @@ sasl_write_cb(void *baton, const char *b
 
   do
     {
-      unsigned int tmplen = sasl_baton->write_len;
+      apr_size_t tmplen = sasl_baton->write_len;
       SVN_ERR(svn_ra_svn__stream_write(sasl_baton->stream,
                                        sasl_baton->write_buf,
                                        &tmplen));


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] fix types in ra_svn SASL stream functions

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@red-bean.com> writes:

> Joe Orton <jo...@redhat.com> writes:
>> These are passing an (unsigned int *) to functions expecting an 
>> (apr_size_t *).
>>
>> * subversion/libsvn_ra_svn/cyrus_auth.c (sasl_read_cb): Fix type of
>> length argument passed to svn_ra_svn__stream_read.
>> (sasl_write_cb): Fix type of length argument passed to
>> svn_ra_svn__stream_write.
>
> Nice catch, r26573.

This fixes the SIGSEGVs I was getting with a misconfigured SASL
server.  In fact since the tests now pass it was perhaps "less than
optimal" rather than "misconfigured".

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] fix types in ra_svn SASL stream functions

Posted by Karl Fogel <kf...@red-bean.com>.
Joe Orton <jo...@redhat.com> writes:
> These are passing an (unsigned int *) to functions expecting an 
> (apr_size_t *).
>
> * subversion/libsvn_ra_svn/cyrus_auth.c (sasl_read_cb): Fix type of
> length argument passed to svn_ra_svn__stream_read.
> (sasl_write_cb): Fix type of length argument passed to
> svn_ra_svn__stream_write.

Nice catch, r26573.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org