Skip to content
OpenAdvisories

Weakness (CWE)

CWE-193: Off-by-one Error

Base Draft

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

How to prevent it (1 mitigation)
  1. Implementation

    When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().

Source: MITRE CWE-193

5 results · Clear filters · Feed

  • Medium 4.4
    CVE-2026-90781 Public exploit

    alsa-lib through 1.2.16.1 Off-by-One Stack Buffer Overflow in __snd_ctl_ascii_elem_id_parse()

    alsa-lib through 1.2.16.1 contains a stack buffer overflow in the __snd_ctl_ascii_elem_id_parse() function that writes one byte past a 64-byte buffer when parsing a name= field with 64 or more characters. Attackers can supply a long control-element identifier…

  • Medium 5.5
    CVE-2024-1441 Public exploit

    Libvirt: off-by-one error in udevlistinterfacesbystatus()

    An off-by-one error flaw was found in the udevListInterfacesByStatus() function in libvirt when the number of interfaces exceeds the size of the `names` array. This issue can be reproduced by sending specially crafted data to the libvirt daemon, allowing an u…

  • Unscored —
    CVE-2021-23017 Public exploit EPSS 53%

    A security issue in nginx resolver was identified, which might allow an attacker who is able to forge UDP packets from …

  • High 7.8
    CVE-2021-3156 Exploited Public exploit EPSS 100%

    Sudo before 1.9.5p2 contains an off-by-one error that can result in a heap-based buffer overflow, which allows privileg…

    KEV Apr 6, 2022
  • Critical 9.8
    CVE-2002-1816 Public exploit

    Off-by-one buffer overflow in the sock_gets function in sockhelp.c for ATPhttpd 0.4b and earlier allows remote attacker…