• P
    cpu: fix possible crash in getModels · 4a4cff58
    Pavel Hrdina 提交于
    Commit 86a15a25 introduced a new cpu driver API 'getModels'. Public API
    allow you to pass NULL for models to get only number of existing models.
    However the new code will crash with segfault so we have to count with
    the possibility that the user wants only the number.
    
    There is also difference in order of the models gathered by this new API
    as the old approach was inserting the elements to the end of the array
    so we should use 'VIR_APPEND_ELEMENT'.
    Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
    4a4cff58
cpu_powerpc.c 16.5 KB