File: empty_block_last

package info (click to toggle)
lwip 2.2.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,008 kB
  • sloc: ansic: 109,524; cs: 6,714; sh: 115; makefile: 112; perl: 81
file content (16 lines) | stat: -rw-r--r-- 658 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: Fix out-of-bound access when only last block is empty
Forwarded: https://savannah.nongnu.org/patch/index.php?10410
Author: Samuel Thibault <sthibault@debian.org>
Last-Update: 2023-11-18

--- a/src/core/ipv6/ip6_addr.c
+++ b/src/core/ipv6/ip6_addr.c
@@ -278,7 +278,7 @@
         }
         break;
       }
-      if (empty_block_flag == 0) {
+      if (empty_block_flag == 0 && current_block_index < 7) {
         /* generate empty block "::", but only if more than one contiguous zero block,
          * according to current formatting suggestions RFC 5952. */
         next_block_value = lwip_htonl(addr->addr[(current_block_index + 1) >> 1]);