libddwaf 1.5.1.0.0 → 1.5.1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38d7409fb731162a26f8ab1a510f2aa3282a9d1889afee95cbc4468be3116f5d
4
- data.tar.gz: c92a1e8d70a5cdc3a8b2d9e42526418013a0d103aa1f827ba47cb857e137281f
3
+ metadata.gz: 99c7eacaabd1402caa1dfe588cde91cb3b8999bfaf0ee4a9edf2fb640ce3497a
4
+ data.tar.gz: 75c8f2ce68fabb48b931ce3fcaad2b9b6c1309d35585e7940e3e94f87e80c805
5
5
  SHA512:
6
- metadata.gz: a256ca93952b9633869b4801212251d04c9d64a84b8276dbc58df0e5aa8249258d4005a2204e3c4db1d2b768f52c9d265731da5c1b0a696a1f812ef7b5662ef1
7
- data.tar.gz: e947f17969ddbe0b996835acff0eff24f7870eacbe1a19df3536623c65ccf9b9c5d392d518e318e657ef4da3513f0f885fb9a040c9c3b7e603ddf13b8af88339
6
+ metadata.gz: c49aaccb9d5ab4b8e9ab386233db336b2235649b2b03a430ad9623970313ad659f4b9e3e92ef93792d23550c48a28c0e0c53f99459372d9f7a22f4409e0c75a3
7
+ data.tar.gz: 607212389e499b3a79aeb12c88de8220184d668247e0508b1816adbfb2e3d2f1e06de875f25d0ef6e403cd127657240c75a052ad29ecddd63a419bc9d81225df
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 2023-02-01 v1.5.1.0.1
2
+
3
+ - Fix incorrect size in input string limit
4
+ - Fix object freeing on `update_rule_data` and `toggle_rules`
5
+
1
6
  # 2022-10-04 v1.5.1.0.0
2
7
 
3
8
  - Update to libddwaf 1.5.1
@@ -3,7 +3,7 @@ module Datadog
3
3
  module WAF
4
4
  module VERSION
5
5
  BASE_STRING = '1.5.1'
6
- STRING = "#{BASE_STRING}.0.0"
6
+ STRING = "#{BASE_STRING}.0.1"
7
7
  MINIMUM_RUBY_VERSION = '2.1'
8
8
  end
9
9
  end
@@ -203,8 +203,8 @@ module Datadog
203
203
  end
204
204
 
205
205
  class Obfuscator < ::FFI::Struct
206
- layout :key_regex, :pointer, # :charptr
207
- :value_regex, :pointer # :charptr
206
+ layout :key_regex, :pointer, # should be :charptr
207
+ :value_regex, :pointer # should be :charptr
208
208
  end
209
209
 
210
210
  layout :limits, Limits,
@@ -539,15 +539,21 @@ module Datadog
539
539
  end
540
540
 
541
541
  def update_rule_data(data)
542
- res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update_rule_data(@handle_obj, Datadog::AppSec::WAF.ruby_to_object(data, coerce: false))
542
+ data_obj = Datadog::AppSec::WAF.ruby_to_object(data, coerce: false)
543
+ res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_update_rule_data(@handle_obj, data_obj)
543
544
 
544
545
  RESULT_CODE[res]
546
+ ensure
547
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(data_obj) if data_obj
545
548
  end
546
549
 
547
550
  def toggle_rules(map)
548
- res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_toggle_rules(@handle_obj, Datadog::AppSec::WAF.ruby_to_object(map, coerce: false))
551
+ map_obj = Datadog::AppSec::WAF.ruby_to_object(map, coerce: false)
552
+ res = Datadog::AppSec::WAF::LibDDWAF.ddwaf_toggle_rules(@handle_obj, map_obj)
549
553
 
550
554
  RESULT_CODE[res]
555
+ ensure
556
+ Datadog::AppSec::WAF::LibDDWAF.ddwaf_object_free(map_obj) if map_obj
551
557
  end
552
558
 
553
559
  private
@@ -627,7 +633,7 @@ module Datadog
627
633
 
628
634
  max_container_size = LibDDWAF::DDWAF_MAX_CONTAINER_SIZE
629
635
  max_container_depth = LibDDWAF::DDWAF_MAX_CONTAINER_DEPTH
630
- max_string_length = LibDDWAF::DDWAF_MAX_CONTAINER_SIZE
636
+ max_string_length = LibDDWAF::DDWAF_MAX_STRING_LENGTH
631
637
 
632
638
  input_obj = Datadog::AppSec::WAF.ruby_to_object(input,
633
639
  max_container_size: max_container_size,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libddwaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1.0.0
4
+ version: 1.5.1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-04 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi