libddwaf 1.9.0.0.0-java → 1.9.0.0.1-java

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: b9f3cf2534d94511ff8bb3bca6c3f8adc7944840fdcd4b8b6a6a650f9c195fd9
4
- data.tar.gz: f621a161f68cf6969909138ac18dfb38c91a5a0dae1a87eba30c78b2b257ec83
3
+ metadata.gz: 7601f47d798fce769438ef48ac48069a0e662cea11c948689015003ea6cbea0b
4
+ data.tar.gz: d907ea758406c750aada22ad0ca7ec0d2ad764fd51e60d875acbd4d1db514604
5
5
  SHA512:
6
- metadata.gz: 0ce2ea4cdcda41484631b9c99238ddba81bcc728c737dfb9031b509ad444f66ed41ef10cd836d5d11824f75d72dc18202824cada909059e0633ae6708827f998
7
- data.tar.gz: d563e57c64429332a3b554b6395a67cae19bd8f5c652a16e1f9fda1e27a1d5b73cac79c57183a1d55e38a33831c0a5fed9aa1d1646b25f5db53abb69f2dec38f
6
+ metadata.gz: 38ff8b367b26bb7e2da6e67f05bfa8817987d71ce949ce1dae3085542db918004e1aadacbb6addda4a8165de950bc6d114f14766b6380a87a42c751850e5c25f
7
+ data.tar.gz: 2884352664d08adc65d6106b7f92af5603c6039a58c7a45ad5881e272c467c9911d2f33a83fb4d461662e45915b0a5136eb8a5d190d14c6f249dbf689b77ea7d
@@ -3,7 +3,7 @@ module Datadog
3
3
  module WAF
4
4
  module VERSION
5
5
  BASE_STRING = '1.9.0'
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
@@ -4,6 +4,7 @@ require 'datadog/appsec/waf/version'
4
4
 
5
5
  module Datadog
6
6
  module AppSec
7
+ # rubocop:disable Metrics/ModuleLength
7
8
  module WAF
8
9
  module LibDDWAF
9
10
  class Error < StandardError
@@ -281,9 +282,9 @@ module Datadog
281
282
 
282
283
  attach_function :ddwaf_set_log_cb, [:ddwaf_log_cb, :ddwaf_log_level], :bool
283
284
 
284
- DEFAULT_MAX_CONTAINER_SIZE = 0
285
- DEFAULT_MAX_CONTAINER_DEPTH = 0
286
- DEFAULT_MAX_STRING_LENGTH = 0
285
+ DEFAULT_MAX_CONTAINER_SIZE = 256
286
+ DEFAULT_MAX_CONTAINER_DEPTH = 20
287
+ DEFAULT_MAX_STRING_LENGTH = 16_384 # in bytes, UTF-8 worst case being 4x size in terms of code point)
287
288
 
288
289
  DDWAF_MAX_CONTAINER_SIZE = 256
289
290
  DDWAF_MAX_CONTAINER_DEPTH = 20
@@ -296,6 +297,7 @@ module Datadog
296
297
  LibDDWAF.ddwaf_get_version
297
298
  end
298
299
 
300
+ # rubocop:disable Metrics/MethodLength
299
301
  def self.ruby_to_object(val, max_container_size: nil, max_container_depth: nil, max_string_length: nil, coerce: true)
300
302
  case val
301
303
  when Array
@@ -349,7 +351,8 @@ module Datadog
349
351
  obj
350
352
  when String
351
353
  obj = LibDDWAF::Object.new
352
- val = val.to_s[0, max_string_length] if max_string_length
354
+ encoded_val = val.to_s.encode('utf-8', invalid: :replace, undef: :replace)
355
+ val = encoded_val[0, max_string_length] if max_string_length
353
356
  str = val.to_s
354
357
  res = LibDDWAF.ddwaf_object_stringl(obj, str, str.bytesize)
355
358
  if res.null?
@@ -405,6 +408,7 @@ module Datadog
405
408
  ruby_to_object(''.freeze)
406
409
  end
407
410
  end
411
+ # rubocop:enable Metrics/MethodLength
408
412
 
409
413
  def self.object_to_ruby(obj)
410
414
  case obj[:type]
@@ -699,5 +703,6 @@ module Datadog
699
703
  end
700
704
  end
701
705
  end
706
+ # rubocop:enable Metrics/ModuleLength
702
707
  end
703
708
  end
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.9.0.0.0
4
+ version: 1.9.0.0.1
5
5
  platform: java
6
6
  authors:
7
7
  - Datadog, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-17 00:00:00.000000000 Z
11
+ date: 2023-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi