Changeset: f09a16cd62c8 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f09a16cd62c8
Modified Files:
        monetdb5/modules/mal/mkey.c
Branch: Dec2016
Log Message:

Protect against wrong use of mkey
The general case of mkey.hash could lead to
incorrect pointer dereferencing.
A defense line has been added.


diffs (15 lines):

diff --git a/monetdb5/modules/mal/mkey.c b/monetdb5/modules/mal/mkey.c
--- a/monetdb5/modules/mal/mkey.c
+++ b/monetdb5/modules/mal/mkey.c
@@ -50,6 +50,11 @@ MKEYhash(Client cntxt, MalBlkPtr mb, Mal
        res= getArgReference_lng(stk,p,0);
        val= getArgReference(stk,p,1);
        switch (ATOMstorage(tpe)) {
+       case TYPE_void:
+       case TYPE_bat:
+       case TYPE_ptr:
+               // illegal types, avoid falling into the default case.
+               assert(0);
        case TYPE_bte:
                *res = MKEYHASH_bte(val);
                break;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to