projects
/
Biblio-RFID.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0cc5010
)
die when trying to decode short tag
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 21 Oct 2014 14:51:23 +0000
(16:51 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 21 Oct 2014 14:57:54 +0000
(16:57 +0200)
lib/Biblio/RFID/RFID501.pm
patch
|
blob
|
history
diff --git
a/lib/Biblio/RFID/RFID501.pm
b/lib/Biblio/RFID/RFID501.pm
index
5c75088
..
1642dc9
100644
(file)
--- a/
lib/Biblio/RFID/RFID501.pm
+++ b/
lib/Biblio/RFID/RFID501.pm
@@
-119,6
+119,10
@@
sub to_hash {
$data = join('', @$data) if ref $data eq 'ARRAY';
+ if ( length($data) < 24 ) {
+ die "short data from tag ", length($data), " < 24 bytes";
+ }
+
warn "## to_hash ",dump($data);
my ( $u1, $set_item, $u2, $type, $content, $br_lib, $custom, $zero ) = unpack('C4Z16Nl>l',$data);