Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

better handling of input

  • Loading branch information...
commit 6941db3dbc3583b82cd0a7da14d828630927ef1e 1 parent 94dd980
avleen authored

Showing 1 changed file with 3 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 htdocs/cgi-bin/register.py
5 htdocs/cgi-bin/register.py
@@ -17,11 +17,12 @@ def main():
17 17 form = cgi.FieldStorage()
18 18 device_id = form.getvalue("deviceid", None)
19 19 registration_id = form.getvalue("registrationid", None)
  20 + if not registration_id or not device_id:
  21 + return
  22 +
20 23 # Sanitize data ftw!
21 24 device_id = re.sub('[^A-Za-z0-9_\-]+', '', device_id)
22 25 registration_id = re.sub('[^A-Za-z0-9_\-]+', '', registration_id)
23   - if not registration_id:
24   - return
25 26
26 27 make_db_conn()
27 28 cur = DB_CONN.cursor()

0 comments on commit 6941db3

Please sign in to comment.
Something went wrong with that request. Please try again.