]> git.alsa-project.org Git - alsa-tools.git/commitdiff
as10k1 - increase max number of macros and check the size
authorTakashi Iwai <tiwai@suse.de>
Fri, 19 Jan 2007 17:30:05 +0000 (18:30 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 19 Jan 2007 17:30:05 +0000 (18:30 +0100)
- Increase the max number of macros to 30.
- Check the current number of macros to avoid segfault.

as10k1/macro.c
as10k1/types.h

index 574b634511321426084e1be671a497b3142edc85..a01ad6fe9db907c6e6299f87688e079466b0c040 100644 (file)
@@ -46,6 +46,10 @@ void new_macro(char *symbol, char *line, char *operand)
 {
         extern int source_line_num;
         struct sym *sym;
+
+       if (macro_ctn >= MAX_DEF_MACRO)
+                as_exit("Parse Error: Too many macros");
+
         if(isalpha(*symbol)==0)
                 as_exit("Parse Error: Symbol must start with an alpha character");
         
index 3aa7564563130ba258b930520f6117c30e383d4d..7bf1fc33a62b71bbbcc276acd434ce43ab4332df 100644 (file)
@@ -108,7 +108,7 @@ struct macrdef{
 #define NO_SYM "__NO_NAME"
 
 
-#define MAX_DEF_MACRO 25
+#define MAX_DEF_MACRO 30
 #define MAX_MAC_DEPTH 5