Project

General

Profile

Bug #2722

bpf_filter's memory array is signed

Added by guy almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Networking
Target version:
-
Start date:
09/02/2014
Due date:
% Done:

0%

Estimated time:

Description

The mem[] array in bpf_filter(), for scratch memory in BPF programs, is an array of signed 32-bit integers. However, 1) all references to it either assign unsigned 32-bit values to elements in the array or assign the value of elements in the array to unsigned 32-bit values, and in some other BSDs it's unsigned.

This shouldn't affect the behavior of the code (at least on 2's-complement machines, but I don't foresee a Univac 2200-series port of any of the BSDs any time soon :-)), but it makes it a bit cleaner and more like some other BSDs (the others will get their own patches) and the current top-of-trunk libpcap.

I've attached a fix.


Files

patch (376 Bytes) patch Patch to fix this guy, 09/02/2014 11:15 AM

History

#1

Updated by sepherosa almost 6 years ago

Fixed, thank!

On Wed, Sep 3, 2014 at 2:15 AM, <> wrote:
> Issue #2722 has been reported by guy.
>
> ----------------------------------------
> Bug #2722: bpf_filter's memory array is signed
> http://bugs.dragonflybsd.org/issues/2722
>
> * Author: guy
> * Status: New
> * Priority: Normal
> * Assignee:
> * Category: Networking
> * Target version:
> ----------------------------------------
> The mem[] array in bpf_filter(), for scratch memory in BPF programs, is an array of signed 32-bit integers. However, 1) all references to it either assign unsigned 32-bit values to elements in the array or assign the value of elements in the array to unsigned 32-bit values, and in some other BSDs it's unsigned.
>
> This shouldn't affect the behavior of the code (at least on 2's-complement machines, but I don't foresee a Univac 2200-series port of any of the BSDs any time soon :-)), but it makes it a bit cleaner and more like some other BSDs (the others will get their own patches) and the current top-of-trunk libpcap.
>
> I've attached a fix.
>
> ---Files--------------------------------
> patch (376 Bytes)
>
>
> --
> You have received this notification because you have either subscribed to it, or are involved in it.
> To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

#2

Updated by swildner almost 6 years ago

  • Status changed from New to Closed

It was pushed (05b1e6eac15534d3ea7e33de2cbccc3d08a286d4)

Also available in: Atom PDF