OneBug This week's bugs
Spot the bug C
1
// Return a heap copy of the given label.
2
char *copy_label(const char *label) {
3
    char *dst = malloc(strlen(label));
4
    if (dst == NULL) return NULL;
5
    strcpy(dst, label);
6
    return dst;
7
}

Read the full write-up for this bug (spoilers)