diff options
author | Marvin W <git@larma.de> | 2017-04-18 17:55:20 +0200 |
---|---|---|
committer | Marvin W <git@larma.de> | 2017-04-18 20:20:41 +0200 |
commit | 7e388fb2bc784568734592dcb2e863dfa061bed4 (patch) | |
tree | eb4fb804fd7cf9df02b39d37b61937f355785810 /plugins/signal-protocol/src/store.vala | |
parent | f95b4f4e0949eefaed871c267626e3ff84ce5ca6 (diff) | |
download | dino-7e388fb2bc784568734592dcb2e863dfa061bed4.tar.gz dino-7e388fb2bc784568734592dcb2e863dfa061bed4.zip |
signal-protocol/omemo: fix null-pointer issues
Fixes #44 and #58
Diffstat (limited to 'plugins/signal-protocol/src/store.vala')
-rw-r--r-- | plugins/signal-protocol/src/store.vala | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/signal-protocol/src/store.vala b/plugins/signal-protocol/src/store.vala index e0d74d0d..eab57e5b 100644 --- a/plugins/signal-protocol/src/store.vala +++ b/plugins/signal-protocol/src/store.vala @@ -142,9 +142,9 @@ public class Store : Object { return 0; } - static int ss_load_session_func(out Buffer buffer, Address address, void* user_data) { + static int ss_load_session_func(out Buffer? buffer, Address address, void* user_data) { Store store = (Store) user_data; - uint8[] res = null; + uint8[]? res = null; try { res = store.session_store.load_session(address); } catch (Error e) { @@ -155,12 +155,12 @@ public class Store : Object { buffer = null; return 0; } - buffer = new Buffer.from(res); + buffer = new Buffer.from((!)res); if (buffer == null) return ErrorCode.NOMEM; return 1; } - static int ss_get_sub_device_sessions_func(out IntList sessions, char[] name, void* user_data) { + static int ss_get_sub_device_sessions_func(out IntList? sessions, char[] name, void* user_data) { Store store = (Store) user_data; try { sessions = store.session_store.get_sub_device_sessions(carr_to_string(name)); @@ -206,9 +206,9 @@ public class Store : Object { return 0; } - static int pks_load_pre_key(out Buffer record, uint32 pre_key_id, void* user_data) { + static int pks_load_pre_key(out Buffer? record, uint32 pre_key_id, void* user_data) { Store store = (Store) user_data; - uint8[] res = null; + uint8[]? res = null; try { res = store.pre_key_store.load_pre_key(pre_key_id); } catch (Error e) { @@ -219,7 +219,7 @@ public class Store : Object { record = new Buffer(0); return 0; } - record = new Buffer.from(res); + record = new Buffer.from((!)res); if (record == null) return ErrorCode.NOMEM; return 1; } @@ -251,9 +251,9 @@ public class Store : Object { return 0; } - static int spks_load_signed_pre_key(out Buffer record, uint32 pre_key_id, void* user_data) { + static int spks_load_signed_pre_key(out Buffer? record, uint32 pre_key_id, void* user_data) { Store store = (Store) user_data; - uint8[] res = null; + uint8[]? res = null; try { res = store.signed_pre_key_store.load_signed_pre_key(pre_key_id); } catch (Error e) { @@ -264,7 +264,7 @@ public class Store : Object { record = new Buffer(0); return 0; } - record = new Buffer.from(res); + record = new Buffer.from((!)res); if (record == null) return ErrorCode.NOMEM; return 1; } |