Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Try to find something dumber if you can...

Try to find something dumber if you can...

Scheduled Pinned Locked Moved The Weird and The Wonderful
database
9 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bernard Laplace
    wrote on last edited by
    #1

    No comment...

    	If Request.QueryString("tsid") IsNot Nothing Then
    		Session("TSID") = sql.SQLValue("SELECT TSID FROM TimeRegHeader 
                                                        WHERE TSID = " & Request.QueryString("tsid"))
    	End If
    
    Z S E 3 Replies Last reply
    0
    • B Bernard Laplace

      No comment...

      	If Request.QueryString("tsid") IsNot Nothing Then
      		Session("TSID") = sql.SQLValue("SELECT TSID FROM TimeRegHeader 
                                                          WHERE TSID = " & Request.QueryString("tsid"))
      	End If
      
      Z Offline
      Z Offline
      zlezj
      wrote on last edited by
      #2

      Do you mean the SQL injection vulnerability, the fact that data is stored in the session object or that you don't like this kind of validation?

      D B 2 Replies Last reply
      0
      • Z zlezj

        Do you mean the SQL injection vulnerability, the fact that data is stored in the session object or that you don't like this kind of validation?

        D Offline
        D Offline
        David Skelly
        wrote on last edited by
        #3

        I think he means the fact that the code sets the value of TSID to the result of a query that selects the value of TSID where the value of TSID is equal to the value of tsid. Or something like that...

        1 Reply Last reply
        0
        • Z zlezj

          Do you mean the SQL injection vulnerability, the fact that data is stored in the session object or that you don't like this kind of validation?

          B Offline
          B Offline
          Bernard Laplace
          wrote on last edited by
          #4

          all what you said + the ad hoc SQL + (cherry on the cake) the fact that it stores in a session variable a TSID value from the database queried from a table where TSID is equal to the TSID from the query string (and no it wasn't designed to validate the existence of the TSID in the database since nothing handles the fact that the returned TSID could be null)...

          1 Reply Last reply
          0
          • B Bernard Laplace

            No comment...

            	If Request.QueryString("tsid") IsNot Nothing Then
            		Session("TSID") = sql.SQLValue("SELECT TSID FROM TimeRegHeader 
                                                                WHERE TSID = " & Request.QueryString("tsid"))
            	End If
            
            S Offline
            S Offline
            Super Lloyd
            wrote on last edited by
            #5

            I think a web service query would have been even better! :rolleyes:

            A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

            1 Reply Last reply
            0
            • B Bernard Laplace

              No comment...

              	If Request.QueryString("tsid") IsNot Nothing Then
              		Session("TSID") = sql.SQLValue("SELECT TSID FROM TimeRegHeader 
                                                                  WHERE TSID = " & Request.QueryString("tsid"))
              	End If
              
              E Offline
              E Offline
              Edbert P
              wrote on last edited by
              #6

              I supported an ASP classic application written by someone in almost the exact same way. Might it possibly be written by the same person idiot?

              "A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia

              P 1 Reply Last reply
              0
              • E Edbert P

                I supported an ASP classic application written by someone in almost the exact same way. Might it possibly be written by the same person idiot?

                "A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia

                P Offline
                P Offline
                Paw Jershauge
                wrote on last edited by
                #7

                Come on.. not all people are as good and professional like you Edbert X| X| , so to call him an idiot, is going to far. just my opinion. I know that the code is bad, but not so bad that i would attack the person who made it, its just like reading this type of code:

                if(UserAllowed == true)
                {
                User.Allowed = true;
                }
                else
                {
                User.Allowed = false;
                }

                Where the code easy could be optimized to simply say: User.Allowed = UserAllowed;. I guess you never did start anywhere else but being a pro at developering. :)

                With great code, comes great complexity, so keep it simple stupid...:-\ :-\

                S E 2 Replies Last reply
                0
                • P Paw Jershauge

                  Come on.. not all people are as good and professional like you Edbert X| X| , so to call him an idiot, is going to far. just my opinion. I know that the code is bad, but not so bad that i would attack the person who made it, its just like reading this type of code:

                  if(UserAllowed == true)
                  {
                  User.Allowed = true;
                  }
                  else
                  {
                  User.Allowed = false;
                  }

                  Where the code easy could be optimized to simply say: User.Allowed = UserAllowed;. I guess you never did start anywhere else but being a pro at developering. :)

                  With great code, comes great complexity, so keep it simple stupid...:-\ :-\

                  S Offline
                  S Offline
                  supercat9
                  wrote on last edited by
                  #8

                  Where the code easy could be optimized to simply say: User.Allowed = UserAllowed;. The question would be whether there would likely be any requirement to do something different in the true and false cases. Incidentally, on some processors, if the source operand is of type bit, the "var1 = var2;" statement may be implemented a number of different ways (for the following examples, the destination is also of type bit; each line is a possible implementation):

                  var1 = 0; if (var2) var1 = 1; /* 3 instructions; 3 cycles */
                  var1 = 1; if (!var2) var1 = 0; /* 3 instructions; 3 cycles */
                  if (!var2) var1 = 0; if (var2) var1 = 1; /* 4 instructions; 4 cycles */
                  if (var2) var1 = 1; if (!var2) var1 = 0; /* 4 instructions; 4 cycles */
                  if (var2) var1 = 1; else var1 = 0; /* 5 instructions; 4 or 5 cycles */
                  if (!var2) var1 = 0; else var1 = 1; /* 5 instructions; 4 or 5 cycles */

                  If var1 is volatile, the first two ways are clearly distinct from the rest. If var1 and var2 are both volatile, the third and fourth ways are also distinct from the fifth and sixth (if var1 starts out 1, and if var2 changes from 0 to 1 between the two 'if' tests, var1 could change twice as a result of the assignment). The fifth and sixth ways are almost identical to each other, except that each will be faster in one case than the other (though one would have to examine the compiled code to know which was faster in each case).

                  1 Reply Last reply
                  0
                  • P Paw Jershauge

                    Come on.. not all people are as good and professional like you Edbert X| X| , so to call him an idiot, is going to far. just my opinion. I know that the code is bad, but not so bad that i would attack the person who made it, its just like reading this type of code:

                    if(UserAllowed == true)
                    {
                    User.Allowed = true;
                    }
                    else
                    {
                    User.Allowed = false;
                    }

                    Where the code easy could be optimized to simply say: User.Allowed = UserAllowed;. I guess you never did start anywhere else but being a pro at developering. :)

                    With great code, comes great complexity, so keep it simple stupid...:-\ :-\

                    E Offline
                    E Offline
                    Edbert P
                    wrote on last edited by
                    #9

                    I reserve my judgment and give the title idiot sparingly and in this case the person is truly an idiot (and no, he's had 10+ years of dev experience). If you had seen the code he wrote you would agree too.

                    "A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin Edbert Sydney, Australia

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups