libddwaf 1.30.0.0.0 → 1.30.0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7da6948ed49013fd79ff999673515b55089e0ae55c873715e66cba77444c1824
4
- data.tar.gz: 871f53275658f176a91a38583cf4b8de5e77e5aa518a588985d9c6c962deb00b
3
+ metadata.gz: 4123acc698a8c1748f01419cf5132b799cbc102066248363123ffd974d9a3387
4
+ data.tar.gz: 338957dec0ad830101148eee5d46522427885afd40816175bc5b145b47c13fc8
5
5
  SHA512:
6
- metadata.gz: 4c1022e41a239a8e53547a01484ef857d8d9837fec5473de295bcf35daeacf06909c696e4be6c6b8d7d3257aee49c9ba718c96bdcb6f5a1745ca2f23ac89fadb
7
- data.tar.gz: 6548c41c12cfb4cf402c32843f6ddaaf5c4cf4fd3b173e1292c3bd56df0c763ea5487240bc07bced9d599960bd41d6e3902c621de37670e2bdab2c4d194dae65
6
+ metadata.gz: d51fa78afeb8a9554847a22f82f14798d72cc92d38a10943c9cdd0aba4f8b0158cb73994eaa1a4901dea0ec5302897e7d41773fd6878c776634ade834ade9e5e
7
+ data.tar.gz: ce34ae26e615b56f48fed0766522ca60c2b342bc77c8e84d98a214ac3f07a4ec5b84e09c0f25519579479a8d6c7cde36d2b50744a963e03b5e396c5945d8289d
data/README.md CHANGED
@@ -3,9 +3,8 @@
3
3
  ``libddwaf-rb`` is library exposing the libddwaf C++ library to Ruby, packaging it in a multiplatform gem.
4
4
 
5
5
  For the libddwaf implementation, see this repository:
6
- - [``libddwaf``: libddwaf](https://github.com/DataDog/libddwaf.git)
7
-
8
6
 
7
+ - [``libddwaf``: libddwaf](https://github.com/DataDog/libddwaf.git)
9
8
 
10
9
  ## Rake tasks
11
10
 
@@ -80,6 +79,15 @@ docker run --privileged --rm tonistiigi/binfmt --install amd64
80
79
 
81
80
  Then you can substitute e.g `--platform linux/x86_64` with `--platform linux/aarch64` below.
82
81
 
82
+ ### Memory leak specs
83
+
84
+ ```
85
+ docker compose run libddwaf-rb bin/build-libddwaf
86
+ docker compose run libddwaf-rb bundle exec rake spec:memory_leaks:all
87
+ ```
88
+
89
+ `bin/build-libddwaf` builds libddwaf with debug headers so that Valgrind produces proper stack traces.
90
+
83
91
  ### GNU (Debian)
84
92
 
85
93
  ```
@@ -5,6 +5,9 @@ module Datadog
5
5
  module WAF
6
6
  # Module responsible for Ruby-to-C and C-to-Ruby conversions
7
7
  module Converter
8
+ INT64_MIN = -(2**63)
9
+ UINT64_MAX = 2**64 - 1
10
+
8
11
  module_function
9
12
 
10
13
  # standard:disable Metrics/MethodLength,Metrics/CyclomaticComplexity
@@ -101,9 +104,11 @@ module Datadog
101
104
  res = if coerce
102
105
  LibDDWAF.ddwaf_object_string(obj, val.to_s)
103
106
  elsif val < 0
104
- LibDDWAF.ddwaf_object_signed(obj, val)
107
+ clamped = val.clamp(INT64_MIN, -1) #: Integer
108
+ LibDDWAF.ddwaf_object_signed(obj, clamped)
105
109
  else
106
- LibDDWAF.ddwaf_object_unsigned(obj, val)
110
+ clamped = val.clamp(0, UINT64_MAX) #: Integer
111
+ LibDDWAF.ddwaf_object_unsigned(obj, clamped)
107
112
  end
108
113
  raise ConversionError, "Could not convert into object: #{val.inspect}" if res.null?
109
114
 
@@ -5,7 +5,7 @@ module Datadog
5
5
  BASE_STRING = "1.30.0"
6
6
  # NOTE: Every change to the `BASE_STRING` should be accompanied
7
7
  # by a reset of the patch version in the `STRING` below.
8
- STRING = "#{BASE_STRING}.0.0"
8
+ STRING = "#{BASE_STRING}.0.1"
9
9
  MINIMUM_RUBY_VERSION = "2.5"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libddwaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0.0.0
4
+ version: 1.30.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-11-11 00:00:00.000000000 Z
10
+ date: 2026-02-27 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: ffi