projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a6efe6
)
gdbm: Ensure filename for do_gdbm_open is null terminated.
author
Matt Birkholz
<matt@birchwood-abbey.net>
Thu, 21 Sep 2017 22:21:15 +0000
(15:21 -0700)
committer
Matt Birkholz
<matt@birchwood-abbey.net>
Thu, 21 Sep 2017 22:21:15 +0000
(15:21 -0700)
src/gdbm/gdbm.scm
patch
|
blob
|
history
diff --git
a/src/gdbm/gdbm.scm
b/src/gdbm/gdbm.scm
index b337e47ff5da61f7aae8a9f09fbfd879be516e79..26062f52671c60f03350965d20845023cb804a38 100644
(file)
--- a/
src/gdbm/gdbm.scm
+++ b/
src/gdbm/gdbm.scm
@@
-67,6
+67,7
@@
USA.
#t)))
(define (->bytes string)
+ ;; NOT necessarily null terminated
(if (and (or (bytevector? string)
(and (ustring? string)
(fix:= 1 (ustring-cp-size string))))
@@
-102,7
+103,7
@@
USA.
gdbf
(lambda ()
(C-call "do_gdbm_open"
- args (
->bytes
filename) block-size flagsnum mode)
+ args (
string->utf8
filename) block-size flagsnum mode)
(if (alien-null? args)
(error "gdbm_open failed: malloc failed")
(if (alien-null? (C-> args "gdbm_args dbf"))