• Ben Collins's avatar
    [PATCH] Fix snd_seq_queue_find_name() · 9ebc87ac
    Ben Collins authored
    While going through sound/ for strncpy replacing, I came across this
    routine:
    
    /* return the (first) queue matching with the specified name */
    queue_t *snd_seq_queue_find_name(char *name)
    {
            int i;
            queue_t *q;
    
            for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) {
                    if ((q = queueptr(i)) != NULL) {
                            if (strncpy(q->name, name, sizeof(q->name)) == 0)
                                    return q;
                            queuefree(q);
                    }
            }
            return NULL;
    }
    
    
    I'm _really_ sure that they meant to use strncmp() here instead.
    
    Like this.
    9ebc87ac
seq_queue.c 19 KB