--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: [libinotify-ocaml-dev] Bad string length
- From: Gregory BELLIER <dest@gatekeeper.fr>
- Date: Mon, 30 Mar 2009 18:34:39 +0200
- Message-id: <49D0F49F.7040507@gatekeeper.fr>
Subject: libinotify-ocaml-dev: Bug in file inotify.ml, bad string length
Package: libinotify-ocaml-dev
Version: 0.7
Severity: important
There is a bug in the file inotify.ml.
I contacted the author but he doesn't reply my emails.
There is a temporary buffer made of lots of \0.
The problem is that we create a new string based on this buffer. The len
is wrong so the fresh string contains too much \0.
For example: say you're monitoring a directory then you create a new
directory named "a".
Because of this event, inotify will notify that a new directory has been
created. Its length ? 16 chars.
That's right 16 chars instead of 1. I noticed this error because of a
badly working concat.
Here is a small working patch already submitted to the author :
Replace the old 'read' function by this one :
let read fd =
let ss = struct_size () in
let toread = to_read fd in
let ret = ref [] in
let buf = String.make toread '\000' in
let toread = Unix.read fd buf 0 toread in
let i = ref 0 in
while !i < toread
do
let wd, l, cookie, len = convert (String.sub buf !i ss) in
let s = if len > 0 then
let str_tmp = (String.sub buf (!i + ss) len) in
let len2 = (String.index str_tmp '\000') in
Some (String.sub str_tmp 0 len2)
else
None
in
ret := (wd, l, cookie, s) :: !ret;
i := !i + (ss + len);
done;
List.rev !ret
Gregory "Dest" BELLIER.
-- System Information:
Debian Release: 4.0
APT prefers oldstable
APT policy: (500, 'oldstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.25.3
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
--- End Message ---
--- Begin Message ---
Source: ocaml-inotify
Source-Version: 0.9-1
We believe that the bug you reported is fixed in the latest version of
ocaml-inotify, which is due to be installed in the Debian FTP archive:
libinotify-ocaml-dev_0.9-1_amd64.deb
to pool/main/o/ocaml-inotify/libinotify-ocaml-dev_0.9-1_amd64.deb
libinotify-ocaml_0.9-1_amd64.deb
to pool/main/o/ocaml-inotify/libinotify-ocaml_0.9-1_amd64.deb
ocaml-inotify_0.9-1.diff.gz
to pool/main/o/ocaml-inotify/ocaml-inotify_0.9-1.diff.gz
ocaml-inotify_0.9-1.dsc
to pool/main/o/ocaml-inotify/ocaml-inotify_0.9-1.dsc
ocaml-inotify_0.9.orig.tar.gz
to pool/main/o/ocaml-inotify/ocaml-inotify_0.9.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 521870@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Sylvain Le Gall <gildor@debian.org> (supplier of updated ocaml-inotify package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Wed, 15 Apr 2009 15:58:56 +0200
Source: ocaml-inotify
Binary: libinotify-ocaml libinotify-ocaml-dev
Architecture: source amd64
Version: 0.9-1
Distribution: unstable
Urgency: low
Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Changed-By: Sylvain Le Gall <gildor@debian.org>
Description:
libinotify-ocaml - OCaml bindings for the inotify API
libinotify-ocaml-dev - OCaml bindings for the inotify API
Closes: 521870
Changes:
ocaml-inotify (0.9-1) unstable; urgency=low
.
* Add debian/gbp.conf to force using pristine-tar
* New Upstream Version (Closes: #521870)
* Change section to "ocaml"
* Upgrade Standards-Version to 3.8.1 (no change)
Checksums-Sha1:
40f020cbaf427476f80a4f9d187b66c496c6a5f5 1363 ocaml-inotify_0.9-1.dsc
1e20874e7fc37f37979c0b7f3b4645c5c8742c5e 12979 ocaml-inotify_0.9.orig.tar.gz
76012681b70cfd05462a41a5cbd043648d1bad4c 2509 ocaml-inotify_0.9-1.diff.gz
1b9a4398a71290692d00ae8d2e969375cb3ef793 5116 libinotify-ocaml_0.9-1_amd64.deb
56c3eae5fc2a2a54dabb6e54098ba8c81ed52ce9 12028 libinotify-ocaml-dev_0.9-1_amd64.deb
Checksums-Sha256:
86f438b18a3c4fdf5239ae1f971ec387c123fdb2e7efe2c55eab831aae4956cc 1363 ocaml-inotify_0.9-1.dsc
cd60b63441797f0ba68c21fd53a3f5bb6884a3d0d5d3689bdbddf75e0a93ccf5 12979 ocaml-inotify_0.9.orig.tar.gz
57b381a3feeae93b520bd9643f0ee2aabbbd2ad583c10dd71df644ac3d3795f0 2509 ocaml-inotify_0.9-1.diff.gz
8f611baf4cdfec771aac6f9b09cbf688d994bc6a638d4108ad740f1648602bb3 5116 libinotify-ocaml_0.9-1_amd64.deb
1c68de2114beaeba708fe9444bd34e9a4c1db37d81c8c9be581547c2acd56d4a 12028 libinotify-ocaml-dev_0.9-1_amd64.deb
Files:
8adf077bcc9e6db3dfee36b80b76ce1a 1363 ocaml optional ocaml-inotify_0.9-1.dsc
b2fc16e5d251219d2c865ba23eb94c50 12979 ocaml optional ocaml-inotify_0.9.orig.tar.gz
697425ca825f6e7d6c1e91976f0b5ae3 2509 ocaml optional ocaml-inotify_0.9-1.diff.gz
690a9762a53065da877d86a4074a89ea 5116 ocaml optional libinotify-ocaml_0.9-1_amd64.deb
304a23cd57d69e1c9a2098f9301ae2dc 12028 ocaml optional libinotify-ocaml-dev_0.9-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iD8DBQFJ5ewwir2bofsN/psRAvGKAJ0aPNJPtaq1b9c7ARmu9MBcV2f/NgCggwEu
/kE4MvTNRE/HaPSrWhj2nXg=
=uMYj
-----END PGP SIGNATURE-----
--- End Message ---