Opened 9 years ago

Last modified 9 years ago

#9324 new Bugs

boost\include\boost-1_53\boost\asio\detail\impl\signal_set_service.ipp Off by One Error

Reported by: Oscar Deits <odeits@…> Owned by: chris_kohlhoff
Milestone: To Be Determined Component: asio
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

In the function

boost::system::error_code signal_set_service::add(
    signal_set_service::implementation_type& impl,
    int signal_number, boost::system::error_code& ec)

The guard statement

// Check that the signal number is valid.
  if (signal_number < 0 || signal_number > max_signal_number)
  {
    ec = boost::asio::error::invalid_argument;
    return ec;
  }

has an Off-by-One error.

The guard statement should read

// Check that the signal number is valid.
  if (signal_number < 0 || signal_number >= max_signal_number)
  {
    ec = boost::asio::error::invalid_argument;
    return ec;
  }

Attachments (1)

signal_set_service.ipp.patch (990 bytes ) - added by Shailesh Venugopal <svenugopal@…> 9 years ago.
Fix for off by one error

Download all attachments as: .zip

Change History (2)

by Shailesh Venugopal <svenugopal@…>, 9 years ago

Fix for off by one error

comment:1 by Shailesh Venugopal <svenugopal@…>, 9 years ago

Component: Noneasio
Owner: set to chris_kohlhoff
Note: See TracTickets for help on using tickets.