Ticket #7056: prevent-overflow.diff
| File prevent-overflow.diff, 0.9 KB (added by thatch, 10 months ago) |
|---|
-
trac/ticket/model.py
87 87 # Fetch the standard ticket fields 88 88 std_fields = [f['name'] for f in self.fields if not f.get('custom')] 89 89 cursor = db.cursor() 90 cursor.execute("SELECT %s,time,changetime FROM ticket WHERE id=%%s" 91 % ','.join(std_fields), (tkt_id,)) 92 row = cursor.fetchone() 90 row = None 91 try: 92 cursor.execute("SELECT %s,time,changetime FROM ticket WHERE id=%%s" 93 % ','.join(std_fields), (tkt_id,)) 94 row = cursor.fetchone() 95 except OverflowError, e: 96 pass 93 97 if not row: 94 98 raise ResourceNotFound('Ticket %s does not exist.' % tkt_id, 95 99 'Invalid Ticket Number')
