RFR: 8254871: Remove unnecessary string copy in NetworkInterface.c
Michael McMahon
michaelm at openjdk.java.net
Tue Oct 27 10:57:20 UTC 2020
On Fri, 23 Oct 2020 03:18:27 GMT, Eric Liu <github.com+10482586+erik1iu at openjdk.org> wrote:
> A small improvement to avoid extra string copy.
>
> [Tests]
> Jtreg hotspot::hotspot_all_no_apps, jdk::jdk_core and langtools::tier1.
> No new failure found.
src/java.base/unix/native/libnet/NetworkInterface.c line 232:
> 230: // if it is virtual sub interface search with parent first.
> 231: colonP = strchr(name_utf, ':');
> 232: size_t limit = colonP != NULL ? (size_t)(colonP - name_utf) : strlen(name_utf);
name_utf is not guaranteed to be null terminated
-------------
PR: https://git.openjdk.java.net/jdk/pull/821
More information about the net-dev
mailing list