Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Tag
Commits
87227315
Commit
87227315
authored
13 years ago
by
Nick Kralevich
Browse files
Options
Download
Email Patches
Plain Diff
more checking for malformed ndef records.
Change-Id: I0a788405b668ef76368fb746ca46d71da387beea
parent
13aac278
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/com/android/apps/tag/record/TextRecord.java
src/com/android/apps/tag/record/TextRecord.java
+1
-0
src/com/android/apps/tag/record/UriRecord.java
src/com/android/apps/tag/record/UriRecord.java
+3
-0
No files found.
src/com/android/apps/tag/record/TextRecord.java
View file @
87227315
...
...
@@ -111,6 +111,7 @@ public class TextRecord extends ParsedNdefRecord {
try
{
byte
[]
payload
=
record
.
getPayload
();
Preconditions
.
checkArgument
(
payload
.
length
>
0
);
/*
* payload[0] contains the "Status Byte Encodings" field, per
...
...
This diff is collapsed.
Click to expand it.
src/com/android/apps/tag/record/UriRecord.java
View file @
87227315
...
...
@@ -223,6 +223,7 @@ public class UriRecord extends ParsedNdefRecord implements OnClickListener {
Preconditions
.
checkArgument
(
Arrays
.
equals
(
record
.
getType
(),
NdefRecord
.
RTD_URI
));
byte
[]
payload
=
record
.
getPayload
();
Preconditions
.
checkArgument
(
payload
.
length
>
0
);
/*
* payload[0] contains the URI Identifier Code, per the
...
...
@@ -233,6 +234,8 @@ public class UriRecord extends ParsedNdefRecord implements OnClickListener {
*/
String
prefix
=
URI_PREFIX_MAP
.
get
(
payload
[
0
]);
Preconditions
.
checkArgument
(
prefix
!=
null
);
byte
[]
fullUri
=
Bytes
.
concat
(
prefix
.
getBytes
(
Charset
.
forName
(
"UTF-8"
)),
Arrays
.
copyOfRange
(
payload
,
1
,
payload
.
length
));
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment