[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-runtime-dev
Subject:    Integrated: JDK-8280004: DCmdArgument<jlong>::parse_value() should handle NULL input
From:       Thomas Stuefe <stuefe () openjdk ! java ! net>
Date:       2022-01-28 8:13:56
Message-ID: 8XhmFXZZne9MzsIwAAPEk01Rp_B1y1k06lDOthGZnuY=.cec12cc5-1ce1-434c-aede-44c15f671367 () github ! com
[Download RAW message or body]

On Fri, 14 Jan 2022 10:40:58 GMT, Thomas Stuefe <stuefe@openjdk.org> wrote:

> Hi,
> 
> may I have eyes please on this simple fix (Sonarcloud-inspired) which sanitizes the \
>                 error output of DCmdArgument<jlong>::parse_value():
> - since the input can be NULL, we should handle NULL
> - we also limit parroting of invalid input to 64 chars max
> - we also do not need a temporary RA buffer to assemble the output
> 
> Example output with patch, first a short, then a long invalid numeric parameter:
> 
> 
> thomas@starfish:~$ jcmd Simple GC.class_histogram -parallel=hallo
> 399746:
> java.lang.IllegalArgumentException: Integer parsing error in command argument \
> '-parallel'. Could not parse: "hallo". thomas@starfish:~$ jcmd Simple \
> GC.class_histogram \
> -parallel=hallo012345678901234567890123456789012345678901234567890123456789012345678 \
> 901234567890123456789012345678901234567890123456789012345678901234567890123456789 \
>                 399746:
> java.lang.IllegalArgumentException: Integer parsing error in command argument \
> '-parallel'. Could not parse: \
> "hallo01234567890123456789012345678901234567890123456789012345678...". 
> 
> Thanks, Thomas

This pull request has now been integrated.

Changeset: 55f180fb
Author:    Thomas Stuefe <stuefe@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/55f180fb7dfecc859e59c7852d48aeab6c936a5d
                
Stats:     11 lines in 1 file changed: 4 ins; 4 del; 3 mod

8280004: DCmdArgument<jlong>::parse_value() should handle NULL input

Reviewed-by: dholmes, mbaesken

-------------

PR: https://git.openjdk.java.net/jdk/pull/7079


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic