summaryrefslogtreecommitdiffstats
path: root/gettext-runtime/intl/printf-parse.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2003-11-17 15:34:21 +0000
committerBruno Haible <bruno@clisp.org>2009-06-23 12:11:18 +0200
commit633ad4418ab3693ba8d05c4027be6ede0361c9f4 (patch)
treec7293544627db2e02d3eaada0453f3de1219958d /gettext-runtime/intl/printf-parse.h
parentf69ac5b2c0d5f4d386d7e2afe0d5650e8b104d28 (diff)
downloadexternal_gettext-633ad4418ab3693ba8d05c4027be6ede0361c9f4.zip
external_gettext-633ad4418ab3693ba8d05c4027be6ede0361c9f4.tar.gz
external_gettext-633ad4418ab3693ba8d05c4027be6ede0361c9f4.tar.bz2
Protect against address arithmetic overflow.
Diffstat (limited to 'gettext-runtime/intl/printf-parse.h')
-rw-r--r--gettext-runtime/intl/printf-parse.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/gettext-runtime/intl/printf-parse.h b/gettext-runtime/intl/printf-parse.h
index 97e432a..754aaf2 100644
--- a/gettext-runtime/intl/printf-parse.h
+++ b/gettext-runtime/intl/printf-parse.h
@@ -1,5 +1,5 @@
/* Parse printf format string.
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published
@@ -21,6 +21,9 @@
#include "printf-args.h"
+/* Get ssize_t. */
+#include <sys/types.h>
+
/* Flags */
#define FLAG_GROUP 1 /* ' flag */
@@ -38,22 +41,22 @@ typedef struct
int flags;
const char* width_start;
const char* width_end;
- int width_arg_index;
+ ssize_t width_arg_index;
const char* precision_start;
const char* precision_end;
- int precision_arg_index;
+ ssize_t precision_arg_index;
char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
- int arg_index;
+ ssize_t arg_index;
}
char_directive;
/* A parsed format string. */
typedef struct
{
- unsigned int count;
+ size_t count;
char_directive *dir;
- unsigned int max_width_length;
- unsigned int max_precision_length;
+ size_t max_width_length;
+ size_t max_precision_length;
}
char_directives;