Bug #13860: Ensure that the DRI mode is in octal format.
This commit is contained in:
parent
c934366424
commit
b5ce0e1d0b
|
@ -71,11 +71,14 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "xf86Parser.h"
|
#include "xf86Parser.h"
|
||||||
|
|
||||||
|
typedef enum { PARSE_DECIMAL, PARSE_OCTAL, PARSE_HEX } ParserNumType;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int num; /* returned number */
|
int num; /* returned number */
|
||||||
char *str; /* private copy of the return-string */
|
char *str; /* private copy of the return-string */
|
||||||
double realnum; /* returned number as a real */
|
double realnum; /* returned number as a real */
|
||||||
|
ParserNumType numType; /* used to enforce correct number formatting */
|
||||||
}
|
}
|
||||||
LexRec, *LexPtr;
|
LexRec, *LexPtr;
|
||||||
|
|
||||||
|
@ -211,6 +214,8 @@ else\
|
||||||
"\ta numerical group id."
|
"\ta numerical group id."
|
||||||
#define MULTIPLE_MSG \
|
#define MULTIPLE_MSG \
|
||||||
"Multiple \"%s\" lines."
|
"Multiple \"%s\" lines."
|
||||||
|
#define MUST_BE_OCTAL_MSG \
|
||||||
|
"The number \"%d\" given in this section must be in octal (0xxx) format."
|
||||||
|
|
||||||
/* Warning messages */
|
/* Warning messages */
|
||||||
#define OBSOLETE_MSG \
|
#define OBSOLETE_MSG \
|
||||||
|
|
|
@ -117,6 +117,8 @@ xf86parseDRISection (void)
|
||||||
case MODE:
|
case MODE:
|
||||||
if (xf86getSubToken (&(ptr->dri_comment)) != NUMBER)
|
if (xf86getSubToken (&(ptr->dri_comment)) != NUMBER)
|
||||||
Error (NUMBER_MSG, "Mode");
|
Error (NUMBER_MSG, "Mode");
|
||||||
|
if (val.numType != PARSE_OCTAL)
|
||||||
|
Error (MUST_BE_OCTAL_MSG, val.num);
|
||||||
ptr->dri_mode = val.num;
|
ptr->dri_mode = val.num;
|
||||||
break;
|
break;
|
||||||
case BUFFERS:
|
case BUFFERS:
|
||||||
|
|
Loading…
Reference in New Issue