Issue 131 in klish: UNIX_MAX_PATH wrong assumption in konf/net/net.c

14 views
Skip to first unread message

kl...@googlecode.com

unread,
Apr 3, 2013, 12:32:10 PM4/3/13
to klis...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 131 by stanisla...@smartcom.bg: UNIX_MAX_PATH wrong assumption in
konf/net/net.c
http://code.google.com/p/klish/issues/detail?id=131

Hi,

In konf/net/net.c, UNIX_MAX_PATH is defined as 108, which on FreeBSD should
be 104.
It appears that other projects have had similar issues, for example
lighttpd:
http://redmine.lighttpd.net/issues/713

Defining UNIX_MAX_PATH as 108 could lead to buffer overflow even on Linux,
should the developers decide to change the size of the char[] this refers
to (it does cause issues on FreeBSD).

The best way seems to be to use sizeof on the sun_path member of the
sockaddr_un struct (as in the patch).

I've tested both on FreeBSD and on Linux and klish compiles cleanly with
the patch.

Best wishes,
Stanislav

Attachments:
konf_net.diff 340 bytes

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

kl...@googlecode.com

unread,
Apr 3, 2013, 1:33:49 PM4/3/13
to klis...@googlegroups.com
Updates:
Status: Fixed

Comment #1 on issue 131 by serj.k...@gmail.com: UNIX_MAX_PATH wrong
Fixed. Thanks!
Now klish doesn't use UNIX_PATH_MAX at all. It uses sizeof(). The two
utilities: konf and konfd were fixed.
Reply all
Reply to author
Forward
0 new messages