Click here to Skip to main content
15,901,122 members

Comments by Barakat S. (Top 5 by date)

Barakat S. 5-Nov-12 7:09am View    
Your page encoding is "ISO-8859-1", you didn't specify any encoding. Check ISO-8859-1 - Latin 1 : http://www.terena.org/activities/multiling/ml-docs/iso-8859.html#ISO-8859-1

To make it UTF-8, add the flowing in top of your php file:

header("Content-type: text/html; charset=utf-8");

for example:

<?php
header("Content-type: text/html; charset=utf-8");

if( isset($_GET["name"]) ) {
echo "name = " . htmlspecialchars($_GET["name"]);
} else {
echo "name = None";
}

?>

It should work fine.
Barakat S. 30-Oct-12 8:37am View    
Don't trust or rely on automation tools. The rule is to not write an insecure code in the first place.

These functions are not "insecure", except for gets, but they can be used in an insecure way. For example, in this piece of code:

+-------------------------------

char buff[10];

if( (argv[1] == NULL) || (strlen(argv[1]) > 9) ) {
fprintf(stderr, "You must pass a string with lenght less than 10\n");
return -1;
}

strcpy(buff, argv[1]);

+-------------------------------

There is no need to use strncpy because you know that a string of length greater than 9 will never pass.

Instead of using tools, learn how to write a secure code. There are many articles there on the Internet on how to do it. I recommend reading through "CERT Secure Coding Standards"[1]. If you use gcc, activate all warnings by passing -Wall and take these warnings seriously. By the time, you will learn on your won.

[1] https://www.securecoding.cert.org/confluence/display/seccode/CERT+Secure+Coding+Standards
Barakat S. 29-Oct-12 10:48am View    
Hey anama, have a look at this question: http://stackoverflow.com/questions/184537/in-what-cases-do-i-use-malloc-vs-new. The diffuseness have been explained pretty well from many different aspects.
Barakat S. 18-Oct-12 3:49am View    
Deleted
The xml files you submitted are not readable:

<pre lang="xml"><string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">
<?xml version="1.0" encoding="UTF-8"?>
<DataCaptureSettings>
<ModuleSettings>
<capture_local_dir>c:\</capture_local_dir>
<capture_log_dir>c:\log</capture_log_dir>
<capture_log_level>debug</capture_log_level>
<capture_request_interval>2</capture_request_interval>
<capture_connection_interval>2</capture_connection_interval>
<smtp_server_name>n1</smtp_server_name>
<smtp_server_port>80</smtp_server_port>
</ModuleSettings>
<Machines>
<Machine>
<MachineId>0022</MachineId>
<AccountId>1</AccountId>
<location_code>LOC_100</location_code>
<Make>Nipro</Make>
<Model>Model1</Model>
<SerialNumber>126649E</SerialNumber>
<IpAddress>10.10.10.10</IpAddress>
<Port>80</Port>
</Machine>
<Machine>
<MachineId>3000</MachineId>
<AccountId>1</AccountId>
<location_code>LOC_100</location_code>
<Make>Make3</Make>
<Model>Model3</Model>
<SerialNumber>SN3</SerialNumber>
<IpAddress>30.30.30.30</IpAddress>
<Port>80</Port>
</Machine>
</Machines>
</DataCaptureSettings>
</string></pre>


<pre lang="xml"><?xml version="1.0" encoding="UTF-8"?>
<DataCaptureSesstings>
<ModuleSettings>
<account_id name="id">1</account_id>
<capture_local_dir>c:</capture_local_dir>
<capture_log_dir>c:log</capture_log_dir>
<capture_log_level>debug</capture_log_level>
<capture_request_interval>2</capture_request_interval>
<capture_connection_interval>2</capture_connection_interval>
<smtp_server_name>n1</smtp_server_name>
<smtp_server_port>80</smtp_server_port>
<smtp_email_sender>s1</smtp_email_sender>
<smtp_email_sender_password>p1</smtp_email_sender_password>
</ModuleSettings>
<MachineList>
<Machine>
<MachineId>0022</MachineId>
<Make>Make1</Make>
<Model>Model1</Model>
<SerialNumber>SN1</SerialNumber>
<IpAddress>10.10.10.10</IpAddress>
<Port>80</Port>
</Machine>
<Machine>
<MachineId>3000</MachineId>
<Make>Make3</Make>
<Model>Model3</Model>
<SerialNumber>SN3</SerialNumber>
<IpAddress>30.30.30.30</IpAddress>
<Port>80</Port>
</Machine>
</MachineList>
</DataCaptureSesstings></pre>

Honestly, I understand nothing from your question. Please try to add more information so no one has to guess.
Barakat S. 16-Oct-12 10:59am View    
Deleted
Are you trying to open a the browser to that page in hidden window?