[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#521870: [libinotify-ocaml-dev] Bad string length



Sylvain Le Gall a écrit :
In gmane.linux.debian.devel.ocaml, you wrote:
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.


The ioctl FIONREAD should return what can be read in the fd. This means
that the string should be exactly the good size when reading...

Could you check the return of ioctl(..., FIONREAD, ...) in your code (in
the C part and in the OCaml part) ?

(use fprintf(stderr, ...) and prerr_endline).

Could you also provide a test to check this error ?

Regards,
Sylvain Le Gall

Alright no problem. I'll do that. In fact, I already did that when I tested.
However, I'm really busy these days so I think it will wait at least a couple of days.


Grégory BELLIER.



Reply to: