Oh, but it is zero, just like you said. I added an assertion:
````
john: memory.c:91: mem_alloc_tiny: Assertion `size > 0' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff6632425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff6632425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff6635b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff662b0ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff662b192 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x0000000000645027 in mem_alloc_tiny (size=0, align=1) at memory.c:91
#5  0x0000000000645207 in mem_alloc_copy (src=0x9af2c0, size=0, align=1) at memory.c:138
#6  0x000000000064242f in ldr_load_pw_line (db=0xf77ae0, 
    line=0x7ffffffce3b0 'a' <repeats 32 times>) at loader.c:609
#7  0x0000000000640a0a in read_file (db=0xf77ae0, name=0x10110a0 "test", flags=2, 
    process_line=0x641e7d <ldr_load_pw_line>) at loader.c:85
#8  0x00000000006427d1 in ldr_load_pw_file (db=0xf77ae0, name=0x10110a0 "test") at loader.c:679
#9  0x000000000063f43a in john_load () at john.c:851
#10 0x000000000063facf in john_init (name=0x7fffffffe7d8 "john", argc=2, argv=0x7fffffffe578)
    at john.c:1081
#11 0x0000000000640667 in main (argc=2, argv=0x7fffffffe578) at john.c:1390
````

A safe fix would be to add
````
        if (size == 0) return NULL;
````
in the beginning of the function. But I'll see if this is actually a bug that should be fixed first. Thanks for finding this problem.