Home
last modified time | relevance | path

Searched hist:"1 cbae705336e905e91f837c88798a5df098c7f67" (Results 1 – 1 of 1) sorted by relevance

/freebsd/sys/kern/
H A Duipc_mqueue.cdiff 1cbae705336e905e91f837c88798a5df098c7f67 Fri Nov 28 15:53:18 CET 2008 Ed Schouten <ed@FreeBSD.org> Fix matching of message queues by name.

The mqfs_search() routine uses strncmp() to match message queue objects
by name. This is because it can be called from environments where the
file name is not null terminated (the VFS for example).

Unfortunately it doesn't compare the lengths of the message queue names,
which means if a system has "Queue12345", the name "Queue" will also
match.

I noticed this when a student of mine handed in an exercise using
message queues with names "Queue2" and "Queue".

Reviewed by: rink
diff 1cbae705336e905e91f837c88798a5df098c7f67 Fri Nov 28 15:53:18 CET 2008 Ed Schouten <ed@FreeBSD.org> Fix matching of message queues by name.

The mqfs_search() routine uses strncmp() to match message queue objects
by name. This is because it can be called from environments where the
file name is not null terminated (the VFS for example).

Unfortunately it doesn't compare the lengths of the message queue names,
which means if a system has "Queue12345", the name "Queue" will also
match.

I noticed this when a student of mine handed in an exercise using
message queues with names "Queue2" and "Queue".

Reviewed by: rink