      def create_clamp_code(nbits, signed)
        if signed == :signed
          max = (1 << (nbits - 1)) - 1
          min = -(max + 1)
        else
          max = (1 << nbits) - 1
          min = 0
        end

        "val = (val < #{min}) ? #{min} : (val > #{max}) ? #{max} : val"
      end
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.