소스 검색

extra check in mg_start(): options may be NULL

valenok 15 년 전
부모
커밋
3e5d2bd3ac
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      mongoose.c

+ 1 - 1
mongoose.c

@@ -3999,7 +3999,7 @@ struct mg_context *mg_start(mg_callback_t user_callback, const char **options) {
   ctx = calloc(1, sizeof(*ctx));
   ctx->user_callback = user_callback;
 
-  while ((name = *options++) != NULL) {
+  while (options && (name = *options++) != NULL) {
     if ((i = get_option_index(name)) == -1) {
       cry(fc(ctx), "Invalid option: %s", name);
       free_context(ctx);