Hi tech@,

The code framework of dmesg.c:

        ......
        struct msgbuf cur;
        char *allocated = NULL;
        ......
        
        if (memf == NULL && nlistf == NULL) {
        ......
        } else {
        #ifndef NOKVM
        ......
        #endif
        }

        if (cur.msg_bufx >= cur.msg_bufs)
                        cur.msg_bufx = 0;
        ......
        free(allocated);
        ......

In reality, is there possible to have "NOKVM" defined (in else branch)?
If so, the "cur" variable will be messy, and "allocated" will be NULL.

Hope to check it, thanks!

Best Regards
Nan Xiao

Reply via email to