mirror of
https://github.com/simonask/libyaml-safer
synced 2024-11-23 03:43:03 +00:00
Factor out MAX_NUMBER_LENGTH constant
This commit is contained in:
parent
9f4591df4c
commit
978fb2213a
1 changed files with 3 additions and 1 deletions
|
@ -2379,6 +2379,8 @@ unsafe fn yaml_parser_scan_version_directive_value(
|
|||
1_i32
|
||||
}
|
||||
|
||||
const MAX_NUMBER_LENGTH: u64 = 9_u64;
|
||||
|
||||
unsafe fn yaml_parser_scan_version_directive_number(
|
||||
parser: *mut yaml_parser_t,
|
||||
start_mark: yaml_mark_t,
|
||||
|
@ -2395,7 +2397,7 @@ unsafe fn yaml_parser_scan_version_directive_number(
|
|||
<= '9' as i32 as yaml_char_t as libc::c_int
|
||||
{
|
||||
length = length.wrapping_add(1);
|
||||
if length > 9_u64 {
|
||||
if length > MAX_NUMBER_LENGTH {
|
||||
return yaml_parser_set_scanner_error(
|
||||
parser,
|
||||
b"while scanning a %YAML directive\0" as *const u8 as *const libc::c_char,
|
||||
|
|
Loading…
Reference in a new issue