epakai / synergy-debian

Synergy packaging for Debian
Other
4 stars 2 forks source link

[488460] unchecked error return codes #55

Open epakai opened 7 years ago

epakai commented 7 years ago

BTS_msg_id: 20080629033848.GQ21122@outflux.net BTS author: Kees Cook kees@outflux.net

--HcccYpVZDxQ8hzPO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline

Package: synergy Version: 1.3.1-4 Severity: normal Tags: patch User: ubuntu-devel@lists.ubuntu.com Usertags: origin-ubuntu intrepid ubuntu-patch

Hello,

This patch fixes a number of cases where error conditions are untested, which cause problems when compiling with -D_FORTIFY_SOURCE=2.

Thanks,

-Kees

-- Kees Cook @outflux.net

--HcccYpVZDxQ8hzPO Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="synergy-fortify.patch"

diff -u synergy-1.3.1/lib/platform/CXWindowsEventQueueBuffer.cpp synergy-1.3.1/lib/platform/CXWindowsEventQueueBuffer.cpp --- synergy-1.3.1/lib/platform/CXWindowsEventQueueBuffer.cpp +++ synergy-1.3.1/lib/platform/CXWindowsEventQueueBuffer.cpp @@ -82,7 +82,7 @@ // clear out the pipe in preparation for waiting.

char buf[16];

--HcccYpVZDxQ8hzPO--

epakai commented 7 years ago

BTS_msg_id: 487B6E19.8030609@licquia.org BTS author: Jeff Licquia jeff@licquia.org

Kees Cook wrote:

This patch fixes a number of cases where error conditions are untested, which cause problems when compiling with -D_FORTIFY_SOURCE=2.

Hi! Sorry for the late reply; just got back from vacation.

I'm not super-keen on diverging from upstream in general unless absolutely necessary. Most of the changes in the patch are "tool patches"; they don't really fix problems in the code itself, but just issues with Fortify. I'm not inclined to include them unless they come down from upstream.

The only two parts that fix real issues, as I see it, are:

The daemonization code is just ugly. I smell a future bug in the code that relies on sequential file descriptor assignment by the OS. So that needs more work.

The pipe flush code is probably a little more correct, but I'd also like to see better handling of unexpected error conditions.