vacfs: fix segfault when no prefix specified

R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5451052
This commit is contained in:
David du Colombier 2011-11-30 15:20:43 -05:00 committed by Russ Cox
parent 83a5aba766
commit aac05c4092

View file

@ -1774,7 +1774,7 @@ vacfsopen(VtConn *z, char *file, int mode, ulong cachemem)
char *prefix;
if(vtparsescore(file, &prefix, score) >= 0){
if(strcmp(prefix, "vac") != 0){
if(prefix == nil || strcmp(prefix, "vac") != 0){
werrstr("not a vac file");
return nil;
}