GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Epoll: setTcpMg5Sig(...) might overflow (#16511) (#16520) · netty/netty@df65997

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • transport-native-epoll/src/main/c
    • netty_epoll_linuxsocket.c
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c‎

Copy file name to clipboardExpand all lines: transport-native-epoll/src/main/c/netty_epoll_linuxsocket.c
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,13 @@ static void netty_epoll_linuxsocket_setTcpMd5Sig(JNIEnv* env, jclass clazz, jint
507507
}
508508

509509
if (key != NULL) {
510-
md5sig.tcpm_keylen = (*env)->GetArrayLength(env, key);
511-
(*env)->GetByteArrayRegion(env, key, 0, md5sig.tcpm_keylen, (void *) &md5sig.tcpm_key);
510+
jint keylen = (*env)->GetArrayLength(env, key);
511+
if (keylen > TCP_MD5SIG_MAXKEYLEN) {
512+
netty_unix_errors_throwIOException(env, "key is too long");
513+
return;
514+
}
515+
md5sig.tcpm_keylen = (u_int16_t) keylen;
516+
(*env)->GetByteArrayRegion(env, key, 0, keylen, (void *) &md5sig.tcpm_key);
512517
if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
513518
return;
514519
}

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.