Check the exceptional case.
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 25 Sep 2012 08:13:17 +0000 (17:13 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 26 Sep 2012 02:41:35 +0000 (11:41 +0900)
for the case of invalid result packet

Change-Id: Idcb7cfe21366046cad25381d51a85c9033b836e4

debian/changelog
livebox-viewer.pc.in
packaging/liblivebox-viewer.spec
src/master_rpc.c

index 552071a..a44d1b2 100644 (file)
@@ -1,3 +1,10 @@
+livebox-viewer (0.6.3) unstable; urgency=low
+
+  * Git: slp/pkgs/l/livebox-viewer
+  * Tag: livebox-viewer_0.6.3
+
+ -- Sung-jae Park <nicesj.park@samsung.com>  Wed, 26 Sep 2012 11:41:18 +0900
+
 livebox-viewer (0.6.2) unstable; urgency=low
 
   * Git: slp/pkgs/l/livebox-viewer
index 2a4b969..06f4891 100644 (file)
@@ -3,7 +3,7 @@ exec_prefix=@EXEC_PREFIX@
 libdir=@LIBDIR@
 includedir=@INCLUDEDIR@
 
-Name: livebox
+Name: livebox-viewer
 Description: livebox supporting library
 Version: @VERSION@
 Libs: -L${libdir} -llivebox-viewer
index c9baac5..0bfce01 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for the development of a livebox viewer
-Version: 0.6.2
+Version: 0.6.3
 Release: 1
 Group: main/app
 License: Samsung Proprietary License
index 910c30b..75cd38a 100644 (file)
@@ -150,7 +150,11 @@ static int done_cb(pid_t pid, int handle, const struct packet *packet, void *dat
                goto out;
        }
 
-       packet_get(packet, "i", &ret);
+       if (packet_get(packet, "i", &ret) != 1) {
+               ErrPrint("Invalid result packet\n");
+               ret = -EINVAL;
+       }
+
        DbgPrint("[%s] Returns: %d\n", packet_command(packet), ret);
 
 out:
@@ -274,7 +278,11 @@ int master_rpc_sync_request(struct packet *packet)
 
        result = com_core_packet_oneshot_send(client_addr(), packet, 0.0f);
        if (result) {
-               packet_get(result, "i", &ret);
+               if (packet_get(result, "i", &ret) != 1) {
+                       ErrPrint("Invalid result packet\n");
+                       ret = -EINVAL;
+               }
+
                packet_unref(result);
        } else {
                ErrPrint("Failed to send a sync request\n");