[maemo-commits] [maemo-commits] r15516 - projects/connectivity/osso-gwobex/trunk/src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue May 6 12:46:30 EEST 2008
Author: jh
Date: 2008-05-06 12:46:22 +0300 (Tue, 06 May 2008)
New Revision: 15516

Modified:
   projects/connectivity/osso-gwobex/trunk/src/obex-priv.c
   projects/connectivity/osso-gwobex/trunk/src/obex-xfer.c
Log:
Check for closed xfer

Modified: projects/connectivity/osso-gwobex/trunk/src/obex-priv.c
===================================================================
--- projects/connectivity/osso-gwobex/trunk/src/obex-priv.c	2008-05-05 06:53:29 UTC (rev 15515)
+++ projects/connectivity/osso-gwobex/trunk/src/obex-priv.c	2008-05-06 09:46:22 UTC (rev 15516)
@@ -379,7 +379,7 @@
     if (actual > 0) {
         xfer->counter += actual;
 
-        debug("obex_readstream: got %d bytes (%d in total)\n", actual, xfer->counter);
+        debug("obex_readstream: got %d bytes (%zd in total)\n", actual, xfer->counter);
 
         if (xfer->async) {
             gint free_space = xfer->buf_size - (xfer->data_start + xfer->data_length);

Modified: projects/connectivity/osso-gwobex/trunk/src/obex-xfer.c
===================================================================
--- projects/connectivity/osso-gwobex/trunk/src/obex-xfer.c	2008-05-05 06:53:29 UTC (rev 15515)
+++ projects/connectivity/osso-gwobex/trunk/src/obex-xfer.c	2008-05-06 09:46:22 UTC (rev 15516)
@@ -192,6 +192,12 @@
 
     debug("gw_obex_xfer_write(buf_size=%d): entered\n", buf_size);
 
+    if (!ctx) {
+        if (err)
+            *err = GW_OBEX_ERROR_INVALID_PARAMS;
+	return FALSE;
+    }
+
     GW_OBEX_LOCK(ctx);
 
     if (ctx->obex_op != OBEX_CMD_PUT) {
@@ -277,6 +283,12 @@
 
     debug("gw_obex_xfer_read(buf_size=%d): entered\n", buf_size);
 
+    if (!ctx) {
+        if (err)
+            *err = GW_OBEX_ERROR_INVALID_PARAMS;
+	return FALSE;
+    }
+
     GW_OBEX_LOCK(ctx);
 
     if (ctx->obex_op != OBEX_CMD_GET) {
@@ -342,6 +354,12 @@
     gboolean ret = TRUE;
     struct gw_obex *ctx = xfer->ctx;
 
+    if (!ctx) {
+        if (err)
+            *err = GW_OBEX_ERROR_INVALID_PARAMS;
+	return FALSE;
+    }
+
     GW_OBEX_LOCK(ctx);
 
     if (ctx->obex_op != OBEX_CMD_PUT)


More information about the maemo-commits mailing list