[gnome-calculator] Fix crash issues due to null pointer dereference
- From: Arth Patel <arthpatel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] Fix crash issues due to null pointer dereference
- Date: Tue, 26 Mar 2013 13:04:12 +0000 (UTC)
commit 3c55d33e6953fb49b2dc5f3ea4dd72438e106539
Author: PioneerAxon <arth svnit gmail com>
Date: Tue Mar 26 02:01:54 2013 +0530
Fix crash issues due to null pointer dereference
src/equation-lexer.vala | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/src/equation-lexer.vala b/src/equation-lexer.vala
index f012168..6d62f4d 100644
--- a/src/equation-lexer.vala
+++ b/src/equation-lexer.vala
@@ -276,12 +276,9 @@ public class Lexer
/* Get next token interface. Will be called by parser to get pointer to next token in token stream. */
public LexerToken get_next_token ()
{
- var token = tokens.nth_data (next_token);
- next_token++;
if (next_token >= tokens.length ())
- next_token = tokens.length ();
-
- return token;
+ return tokens.nth_data (tokens.length () - 1);
+ return tokens.nth_data (next_token++);
}
/* Roll back one lexer token. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]