Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit74dde13

Browse files
committed
This makes encrypt() parser more strict.
Marko Kreen
1 parent57040f7 commit74dde13

File tree

1 file changed

+12
-10
lines changed
  • contrib/pgcrypto

1 file changed

+12
-10
lines changed

‎contrib/pgcrypto/px.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2727
* SUCH DAMAGE.
2828
*
29-
* $Id: px.c,v 1.1 2001/08/21 01:32:01 momjian Exp $
29+
* $Id: px.c,v 1.2 2001/09/06 03:21:39 momjian Exp $
3030
*/
3131

3232
#include<postgres.h>
@@ -208,7 +208,7 @@ combo_free(PX_Combo *cx)
208208

209209
/* PARSER */
210210

211-
staticvoid
211+
staticint
212212
parse_cipher_name(char*full,char**cipher,char**pad)
213213
{
214214
char*p,*p2,*q;
@@ -229,14 +229,16 @@ parse_cipher_name(char *full, char **cipher, char **pad)
229229
p2=strchr(p,':');
230230
if (p2!=NULL) {
231231
*p2++=0;
232-
if (!strcmp(p,"pad")) {
232+
if (!strcmp(p,"pad"))
233233
*pad=p2;
234-
}else {
235-
elog(ERROR,"Unknown component: '%s'",p);
236-
}
237-
}
234+
else
235+
return-1;
236+
}else
237+
return-1;
238+
238239
p=q;
239240
}
241+
return0;
240242
}
241243

242244
/* provider */
@@ -255,11 +257,11 @@ px_find_combo(const char *name, PX_Combo **res)
255257
buf=px_alloc(strlen(name)+1);
256258
strcpy(buf,name);
257259

258-
parse_cipher_name(buf,&s_cipher,&s_pad);
259-
if (s_cipher==NULL) {
260+
err=parse_cipher_name(buf,&s_cipher,&s_pad);
261+
if (err) {
260262
px_free(buf);
261263
px_free(cx);
262-
return-1;
264+
returnerr;
263265
}
264266

265267
err=px_find_cipher(s_cipher,&cx->cipher);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp