From df226d92954ee0cea1bc51d3be8f0d536537162c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 6 Sep 2020 18:55:08 +0200 Subject: [PATCH] Fix crash in Util.fromUtf8() A null pointer was dereferenced when the lib returned a null string. --- lib/src/util.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/util.dart b/lib/src/util.dart index 34e3c84..774fe85 100644 --- a/lib/src/util.dart +++ b/lib/src/util.dart @@ -60,6 +60,7 @@ class Util { } static String fromUtf8(ffi.Pointer str) { + if (str.address == 0x0) return null; return ffi.Utf8.fromUtf8(str.cast()); }