Merge pull request #1399 from calmh/uintsize
avoid out of bounds write in unlock_notify_wait on 64 bit platforms
This commit is contained in:
@@ -21,6 +21,7 @@ package sqlite3
|
||||
extern void unlock_notify_callback(void *arg, int argc);
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -82,7 +83,7 @@ func unlock_notify_wait(db *C.sqlite3) C.int {
|
||||
h := unt.add(c)
|
||||
defer unt.remove(h)
|
||||
|
||||
pargv := C.malloc(C.sizeof_uint)
|
||||
pargv := C.malloc(C.size_t(unsafe.Sizeof(uint(0))))
|
||||
defer C.free(pargv)
|
||||
|
||||
argv := (*[1]uint)(pargv)
|
||||
|
||||
Reference in New Issue
Block a user