Skip to content

Commit

Permalink
Fix crash in Util.fromUtf8()
Browse files Browse the repository at this point in the history
A null pointer was dereferenced when the lib returned a null string.
  • Loading branch information
jpnurmi committed Sep 6, 2020
1 parent dca2fc3 commit df226d9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Util {
}

static String fromUtf8(ffi.Pointer<ffi.Int8> str) {
if (str.address == 0x0) return null;
return ffi.Utf8.fromUtf8(str.cast<ffi.Utf8>());
}

Expand Down

0 comments on commit df226d9

Please sign in to comment.