Bad string length
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ocaml-inotify (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: libinotify-
Ubuntu version concerned : jaunty and older
Severity : important
Found in version 0.7
Fixed in version 0.9
Hi guys !
I filled a report on the Debian's bug tracking and I'm now reporting it here.
You can find the full report which is now closed here : http://
This bug is in the package libinotify-
I don't know if you have time to patch your tree before releasing jaunty.
Anyway, there is a bug in the file inotify.ml.
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 name length ? 16 chars.
That's right 16 chars instead of 1. I noticed this error because of a
badly working concat.
I patched the sources in order to print the error :
ocamlc unix.cma -I /usr/lib/
test_err test.inotify.ml
mkdir /tmp/dev
./test_err /tmp/dev 2> hello2.txt
mkdir /tmp/dev/a
cat hello2.txt
We're in inotify_stubs.c
# bytes returned from ioctl: 32
From here, we're in inotify.ml
# toread (it's what we get from inotify_stubs) : 32
Length of string 'a' = 16
Let's iterate on this string to print all chars :
'a' '' '' '' '' '' '' '' '' '' '' ''
'' '' '' ''
As you can see with the '', there are too much \0 in the string but I
think the line "Length of string 'a' = 16" speaks for itself.
I've been in contact with the bind's author of inotify -> ocaml and he released the 0.9 (see attachment) as a patch for this bug.
Regards,
Gregory "Dest" BELLIER.
Changed in ocaml-inotify (Ubuntu): | |
status: | New → Fix Released |