• L
    util: check for null ifname inside virNetDevBandwidthSet() · 153b06c6
    Laine Stump 提交于
    Previously this function relied on having ATTRIBUTE_NONNULL(1) in its
    prototype rather than explicitly checking for a null
    ifname. Unfortunately, ATTRIBUTE_NONNULL is just a hint to the
    optimizer and code analyzers like Coverity, it doesn't actually check
    anything at execution time, so the result was possible warnings from
    Coverity, along with the possibility of null dereferences when ifname
    wasn't available.
    
    This patch removes the ATTRIBUTE_NONNULL from the prototype, and
    checks ifname inside the function, logging an error if it's NULL (once
    we've determined that the user really is trying to set a bandwidth).
    153b06c6
virnetdevbandwidth.h 2.8 KB