aserver: fix buffer overwriting