public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] pan: fix potential overrun in tag_report
@ 2013-03-21 15:08 Jan Stancek
  2013-03-22  2:43 ` Wanlong Gao
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2013-03-21 15:08 UTC (permalink / raw)
  To: ltp-list

  char *cuts_info[5];
  ...
  while (tok_num < 5 &&
      (cuts_info[++tok_num] = strtok(NULL, "\t ")) != NULL) ;

While above can run for tok_num == 4, in which case:
  cuts_info[++tok_num] becomes cuts_info[5]
and that is outside of cuts_info array.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 pan/tag_report.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pan/tag_report.c b/pan/tag_report.c
index 473bed1..61caabd 100644
--- a/pan/tag_report.c
+++ b/pan/tag_report.c
@@ -425,7 +425,7 @@ SYM tags;
 int cuts_testcase(tag, keys)
 SYM tag, keys;
 {
-	char *cuts_info[5];
+	char *cuts_info[6];
 	char key[KEYSIZE];
 	char *oldresult, *newresult, *worst_case();
 	int tok_num = 0;
-- 
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] pan: fix potential overrun in tag_report
  2013-03-21 15:08 [LTP] [PATCH] pan: fix potential overrun in tag_report Jan Stancek
@ 2013-03-22  2:43 ` Wanlong Gao
  0 siblings, 0 replies; 2+ messages in thread
From: Wanlong Gao @ 2013-03-22  2:43 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

On 03/21/2013 11:08 PM, Jan Stancek wrote:
>   char *cuts_info[5];
>   ...
>   while (tok_num < 5 &&
>       (cuts_info[++tok_num] = strtok(NULL, "\t ")) != NULL) ;
> 
> While above can run for tok_num == 4, in which case:
>   cuts_info[++tok_num] becomes cuts_info[5]
> and that is outside of cuts_info array.
> 
> Signed-off-by: Jan Stancek <jstancek@redhat.com>


Applied, thank you.

Wanlong Gao


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-22  2:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-21 15:08 [LTP] [PATCH] pan: fix potential overrun in tag_report Jan Stancek
2013-03-22  2:43 ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox