tools/firewire: nosy-dump: work around segfault in decode_fcp
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Thu, 22 Jul 2010 09:58:05 +0000 (11:58 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Tue, 27 Jul 2010 09:04:12 +0000 (11:04 +0200)
If I run "nosy-dump --view=transaction" with my camcorder on battery
instead of mains, it segfaults very quickly because of !t->request.
Perhaps this is because of increased likelyhood of incomplete
transactions (ack_busy when host writes to camcorder's FCP_Request)
and a bug deeper in nosy-dump's transaction housekeeping.  This is a
quick workaround to get me going.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
tools/firewire/nosy-dump.c

index 0bad0a42d7725cc9069d27cd32776d014e36acc0..1d4dd5439d43471ad5d3a322d0d1104a3a478a00 100644 (file)
@@ -230,6 +230,11 @@ handle_transaction(struct link_transaction *t)
   struct subaction *sa;
   int i;
 
+  if (!t->request) {
+    printf("BUG in handle_transaction\n");
+    return;
+  }
+
   for (i = 0; i < array_length(protocol_decoders); i++)
     if (protocol_decoders[i].decode(t))
       break;